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


PHP CRM_Core_Form::preProcess方法代码示例

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


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

示例1: preProcess

 /**
  * Overridden parent method to perform processing before form is build
  *
  * @access public
  */
 public function preProcess()
 {
     $this->ruleActionId = CRM_Utils_Request::retrieve('rule_action_id', 'Integer');
     $this->ruleAction = new CRM_Civirules_BAO_RuleAction();
     $this->ruleAction->id = $this->ruleActionId;
     $this->action = new CRM_Civirules_BAO_Action();
     $this->rule = new CRM_Civirules_BAO_Rule();
     $this->trigger = new CRM_Civirules_BAO_Trigger();
     if (!$this->ruleAction->find(true)) {
         throw new Exception('Civirules could not find ruleAction');
     }
     $this->action->id = $this->ruleAction->action_id;
     if (!$this->action->find(true)) {
         throw new Exception('Civirules could not find action');
     }
     $this->rule->id = $this->ruleAction->rule_id;
     if (!$this->rule->find(true)) {
         throw new Exception('Civirules could not find rule');
     }
     $this->trigger->id = $this->rule->trigger_id;
     if (!$this->trigger->find(true)) {
         throw new Exception('Civirules could not find trigger');
     }
     $this->triggerClass = CRM_Civirules_BAO_Trigger::getPostTriggerObjectByClassName($this->trigger->class_name, true);
     $this->triggerClass->setTriggerId($this->trigger->id);
     //set user context
     $session = CRM_Core_Session::singleton();
     $editUrl = CRM_Utils_System::url('civicrm/civirule/form/rule', 'action=update&id=' . $this->rule->id, TRUE);
     $session->pushUserContext($editUrl);
     parent::preProcess();
     $this->setFormTitle();
 }
开发者ID:alejandro-ixiam,项目名称:org.civicoop.civirules,代码行数:37,代码来源:Form.php

示例2: preProcess

 /**
  * Function to set variables up before form is built
  * 
  * @param null
  * 
  * @return void
  * @access public
  */
 public function preProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         //check permission for action.
         if (!CRM_Core_Permission::checkActionPermission('CiviContribute', $this->_action)) {
             CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
         }
         $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
         $this->_title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_PCP', $this->_id, 'title');
         $this->assign('title', $this->_title);
         parent::preProcess();
     }
     if (!$this->_action) {
         $action = CRM_Utils_Array::value('action', $_GET);
         $id = CRM_Utils_Array::value('id', $_GET);
         switch ($action) {
             case 'delete':
                 require_once 'CRM/Contribute/BAO/PCP.php';
                 $title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_PCP', $id, 'title');
                 CRM_Contribute_BAO_PCP::delete($id);
                 CRM_Core_Session::setStatus(ts("The Campaign Page '%1' has been deleted.", array(1 => $title)));
                 break;
             case 'disable':
                 require_once 'CRM/Contribute/BAO/PCP.php';
                 CRM_Contribute_BAO_PCP::setDisable($id, '0');
                 break;
             case 'enable':
                 require_once 'CRM/Contribute/BAO/PCP.php';
                 CRM_Contribute_BAO_PCP::setDisable($id, '1');
                 break;
         }
         $session =& CRM_Core_Session::singleton();
         CRM_Utils_System::redirect($session->popUserContext());
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:43,代码来源:PCP.php

示例3: preProcess

 /**
  * TODO: How many checks do we need to do? Should we check to make sure the
  * activity is the right type? That the cid and aid are associated? Seems like
  * if you are messing with URL params you are kind of asking for trouble...
  */
 function preProcess()
 {
     $this->_aid = CRM_Utils_Request::retrieve('aid', 'Positive', $this, FALSE);
     $this->_cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE);
     $this->_vid = CRM_Utils_Request::retrieve('vid', 'Positive', $this, FALSE);
     if (!CRM_Volunteer_Permission::checkProjectPerms(CRM_Core_Action::UPDATE, $this->_vid)) {
         CRM_Utils_System::permissionDenied();
     }
     if (!$this->_aid && !($this->_cid && $this->_vid)) {
         CRM_Core_Error::fatal("Form expects an activity ID or both a contact and a volunteer project ID.");
     }
     $check = array('Activity' => $this->_aid, 'Contact' => $this->_cid, 'VolunteerProject' => $this->_vid);
     $errors = array();
     foreach ($check as $entityType => $entityID) {
         if (!$this->entityExists($entityType, $entityID)) {
             $errors[] = "No {$entityType} with ID {$entityID} exists.";
         }
     }
     if (count($errors)) {
         CRM_Core_Error::fatal("Invalid parameter(s) passed to commendation form: " . implode(' ', $errors));
     }
     $contact_display_name = civicrm_api3('Contact', 'getvalue', array('id' => $this->_cid, 'return' => 'display_name'));
     CRM_Utils_System::setTitle(ts('Commend %1', array(1 => $contact_display_name, 'domain' => 'org.civicrm.volunteer')));
     parent::preProcess();
 }
开发者ID:TobiasLounsbury,项目名称:org.civicrm.volunteer,代码行数:30,代码来源:Commendation.php

示例4: preProcess

 function preProcess()
 {
     parent::preProcess();
     $bao = $this->controller->getImportBAO();
     $this->assign('importId', $bao->getImportId());
     $this->assign('importSummary', $this->get('importSummary'));
 }
开发者ID:hoegrammer,项目名称:uk.co.vedaconsulting.module.justgivingImports,代码行数:7,代码来源:Validate.php

示例5: preProcess

 public function preProcess()
 {
     // we do not want to display recently viewed items, so turn off
     $this->assign('displayRecent', FALSE);
     // component null in controller object - fix? dgg
     // $this->_component = $this->controller->get('component');
     $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this);
     $this->assign('component', $this->_component);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->assign('context', $this->_context);
     $this->_pageId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
     $title = ts('Setup a Personal Campaign Page - Step 2');
     if ($this->_pageId) {
         $title = ts('Edit Your Personal Campaign Page');
     }
     CRM_Utils_System::setTitle($title);
     //MV: to get the Custom Data preProcess
     if (CRM_Core_Permission::check('administer CiviCRM')) {
         $this->_cdType = 'PCP';
         $this->_customValueCount = 1;
         CRM_Custom_Form_CustomData::preProcess($this, NULL, NULL, 1, $this->_cdType, $this->_pageId, NULL);
     }
     //END
     parent::preProcess();
 }
开发者ID:eruraindil,项目名称:uk.co.vedaconsulting.pcpteams,代码行数:25,代码来源:Campaign.php

示例6: preProcess

 public function preProcess()
 {
     parent::preProcess();
     $this->_groupID = CRM_Utils_Request::retrieve('gid', 'Integer', $this, FALSE, NULL, 'REQUEST');
     // ensure that there is a destination, if not set the destination to the
     // referrer string
     if (!$this->controller->getDestination()) {
         $this->controller->setDestination(NULL, TRUE);
     }
     if ($this->_groupID) {
         $groupTypeCondition = CRM_Contact_BAO_Group::groupTypeCondition('Mailing');
         // make sure requested qroup is accessible and exists
         $query = "\nSELECT   title, description\n  FROM   civicrm_group\n WHERE   id={$this->_groupID}\n   AND   visibility != 'User and User Admin Only'\n   AND   {$groupTypeCondition}";
         $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
         if ($dao->fetch()) {
             $this->assign('groupName', $dao->title);
             CRM_Utils_System::setTitle(ts('Subscribe to Mailing List - %1', array(1 => $dao->title)));
         } else {
             CRM_Core_Error::statusBounce("The specified group is not configured for this action OR The group doesn't exist.");
         }
         $this->assign('single', TRUE);
     } else {
         $this->assign('single', FALSE);
         CRM_Utils_System::setTitle(ts('Mailing List Subscription'));
     }
 }
开发者ID:kidaa30,项目名称:yes,代码行数:26,代码来源:Subscribe.php

示例7: preProcess

 /**
  * Function to set variables up before form is built
  *
  * @return void
  * @access public
  */
 public function preProcess()
 {
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0, 'REQUEST');
     $this->_isTemplate = (bool) CRM_Utils_Request::retrieve('template', 'Integer', $this);
     $this->_jobPosition = CRM_Core_DAO::getFieldValue('CRM_HRRecruitment_DAO_HRVacancy', $this->_id, 'position');
     parent::preProcess();
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:13,代码来源:Delete.php

示例8: preProcess

 /**
  * Overridden parent method to perform processing before form is build
  *
  * @access public
  */
 public function preProcess()
 {
     $this->ruleConditionId = CRM_Utils_Request::retrieve('rule_condition_id', 'Integer');
     $this->ruleCondition = new CRM_Civirules_BAO_RuleCondition();
     $this->ruleCondition->id = $this->ruleConditionId;
     $this->condition = new CRM_Civirules_BAO_Condition();
     $this->rule = new CRM_Civirules_BAO_Rule();
     $this->event = new CRM_Civirules_BAO_Event();
     if (!$this->ruleCondition->find(true)) {
         throw new Exception('Civirules could not find ruleCondition');
     }
     $this->condition->id = $this->ruleCondition->condition_id;
     if (!$this->condition->find(true)) {
         throw new Exception('Civirules could not find condition');
     }
     $this->rule->id = $this->ruleCondition->rule_id;
     if (!$this->rule->find(true)) {
         throw new Exception('Civirules could not find rule');
     }
     $this->event->id = $this->rule->event_id;
     if (!$this->event->find(true)) {
         throw new Exception('Civirules could not find event');
     }
     $this->eventClass = CRM_Civirules_BAO_Event::getPostEventObjectByClassName($this->event->class_name, true);
     $this->eventClass->setEventId($this->event->id);
     parent::preProcess();
 }
开发者ID:JMAConsulting,项目名称:org.civicoop.civirules,代码行数:32,代码来源:FieldValueComparison.php

示例9: preProcess

 public function preProcess()
 {
     if (!CRM_Core_Permission::check('access CiviCRM') || !CRM_Core_Permission::check('administer CiviCRM')) {
         CRM_Utils_System::permissionDenied();
         exit;
     }
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, false);
     $this->_object = CRM_Utils_Request::retrieve('object', 'String', $this, true);
     $isObjectID = true;
     if ($this->_action & CRM_Core_Action::ADD) {
         $isObjectID = false;
     }
     $this->_objectID = CRM_Utils_Request::retrieve('objectID', 'Integer', $this, $isObjectID);
     $this->_customFields = array();
     $this->assign('object', $this->_object);
     if ($this->_object == 'fee') {
         $this->_tableName = 'civicrm_value_extended_care_fee_tracker';
         CRM_Utils_System::setTitle(ts('Configure Fee Entry'));
         $this->_customFields = array('entity_id', 'fee_type', 'category', 'description', 'fee_date', 'total_blocks');
     } else {
         $this->_tableName = 'civicrm_value_extended_care_signout';
         CRM_Utils_System::setTitle(ts('Configure Activity block'));
         $this->_customFields = array('entity_id', 'pickup_person_name', 'signin_time', 'signout_time', 'class', 'is_morning', 'at_school_meeting');
     }
     $this->assign('fields', $this->_customFields);
     parent::preProcess();
 }
开发者ID:pzingg,项目名称:sfschool,代码行数:27,代码来源:ExtendedCare.php

示例10: preProcess

 function preProcess()
 {
     //$source = CRM_Utils_Request::retrieve('source', 'String', $this, true);
     //$id = CRM_Utils_Request::retrieve('id', 'Int', $this, true);
     //$this->loadItem($source, $id);
     CRM_Utils_System::setTitle('Import');
     parent::preProcess();
 }
开发者ID:hoegrammer,项目名称:uk.co.vedaconsulting.module.justgivingImports,代码行数:8,代码来源:Import.php

示例11: preProcess

 function preProcess()
 {
     parent::preProcess();
     $this->_startDate = CRM_Utils_Request::retrieve('startDate', 'String', $this, false, date('Y-m-d', time() - 7 * 24 * 60 * 60));
     $this->_endDate = CRM_Utils_Request::retrieve('endDate', 'String', $this, false, date('Y-m-d'));
     $this->_includeMorning = CRM_Utils_Request::retrieve('includeMorning', 'Integer', $this, false, 1);
     $this->_showDetails = CRM_Utils_Request::retrieve('showDetails', 'Integer', $this, false, 1);
     $this->_notSignedOut = CRM_Utils_Request::retrieve('notSignedOut', 'Integer', $this, false, 0);
 }
开发者ID:pzingg,项目名称:sfschool,代码行数:9,代码来源:ExtendedCareSummary.php

示例12: preProcess

 function preProcess()
 {
     parent::preProcess();
     $result = civicrm_api3('Setting', 'getfields');
     $this->_settingsMetadata = $result['count'] > 0 ? $result['values'] : array();
     $currentDomainId = civicrm_api3('Domain', 'getvalue', array('return' => 'id', 'current_domain' => 1));
     $setting = civicrm_api3('Setting', 'get');
     $this->_settings = $setting['values'][$currentDomainId];
 }
开发者ID:TobiasLounsbury,项目名称:org.civicrm.volunteer,代码行数:9,代码来源:Settings.php

示例13: preProcess

 function preProcess()
 {
     parent::preProcess();
     CRM_Utils_System::setTitle(ts('Settings - Booking Preferences Configuration'));
     $configValue = CRM_Booking_BAO_BookingConfig::getConfig();
     $this->_config = $configValue;
     // load up javascript, css
     self::registerScripts();
 }
开发者ID:sushantpaste,项目名称:civibooking,代码行数:9,代码来源:Booking.php

示例14: preProcess

 public function preProcess()
 {
     $this->_indexID = CRM_Utils_Request::retrieve('id', 'Integer', $this, FALSE);
     $this->_config = CRM_Utils_Request::retrieve('config', 'Integer', $this, 0);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/tplstrings', 'reset=1'));
     CRM_Utils_System::setTitle(ts('DB Template Strings'));
     parent::preProcess();
 }
开发者ID:kidaa30,项目名称:yes,代码行数:10,代码来源:Persistent.php

示例15: preProcess

 function preProcess()
 {
     CRM_Core_Resources::singleton()->addScriptFile('com.zyxware.civiwci', 'js/createwidget.js');
     parent::preProcess();
     if (isset($_REQUEST['id'])) {
         $this->assign('emb_id', $_REQUEST['id']);
     }
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'REQUEST');
     $this->_colorFields = array('color_title' => array(ts('Title Text Color'), 'text', FALSE, '#BF0F0F'), 'color_title_bg' => array(ts('Title background color'), 'text', FALSE, '#FFFFFF'), 'color_bar' => array(ts('Progress Bar Color'), 'text', FALSE, '#BF0F0F'), 'color_bar_bg' => array(ts('Progress Bar Background Color'), 'text', FALSE, '#FFFFFF'), 'color_widget_bg' => array(ts('Background color'), 'text', FALSE, '#FFFFFF'), 'color_description' => array(ts('Description color'), 'text', FALSE, '#000000'), 'color_border' => array(ts('Border color'), 'text', FALSE, '#BF0F0F'), 'color_button' => array(ts('Button text color'), 'text', FALSE, '#FFFFFF'), 'color_button_bg' => array(ts('Button background color'), 'text', FALSE, '#BF0F0F'), 'color_btn_newsletter' => array(ts('Newsletter Button text color'), 'text', FALSE, '#FFFFFF'), 'color_btn_newsletter_bg' => array(ts('Newsletter Button color'), 'text', FALSE, '#BF0F0F'), 'newsletter_text' => array(ts('Newsletter text'), 'text', FALSE, 'Get the monthly newsletter'), 'color_newsletter_text' => array(ts('Newsletter text color'), 'text', FALSE, '#BF0F0F'));
 }
开发者ID:aneeshbhadran,项目名称:civiwci,代码行数:10,代码来源:CreateWidget.php


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