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


PHP CRM_Core_Controller_Simple::process方法代码示例

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


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

示例1: 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

示例2: run

 /**
  * Run the page.
  *
  * This method is called after the page is created.
  *
  * @return void
  * @access public
  *
  */
 function run()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_Task_Useradd', ts('Add User'), CRM_Core_Action::ADD);
     $controller->setEmbedded(TRUE);
     $controller->process();
     $controller->run();
     return parent::run();
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:17,代码来源:Useradd.php

示例3: run

 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);
     if ($action & CRM_Core_Action::UPDATE) {
         $controller = new CRM_Core_Controller_Simple('CRM_Wci_Form_ProgressBar', 'Edit Progressbar', CRM_Core_Action::UPDATE);
         $controller->set('id', $id);
         $controller->process();
         return $controller->run();
     } elseif ($action & CRM_Core_Action::COPY) {
         try {
             $sql = "INSERT INTO civicrm_wci_progress_bar (name, starting_amount, goal_amount)\n        SELECT concat(name, '-', (SELECT MAX(id) FROM civicrm_wci_progress_bar)),\n        starting_amount, goal_amount FROM civicrm_wci_progress_bar\n        WHERE id=%1";
             CRM_Core_DAO::executeQuery($sql, array(1 => array($id, 'Integer')));
             $new_pb_id = CRM_Core_DAO::singleValueQuery('SELECT LAST_INSERT_ID()');
             $sql = "INSERT INTO civicrm_wci_progress_bar_formula\n            (contribution_page_id, financial_type_id, progress_bar_id, start_date, end_date, percentage)\n            SELECT contribution_page_id, financial_type_id, %1, start_date,\n            end_date, percentage FROM civicrm_wci_progress_bar_formula WHERE progress_bar_id=%2";
             CRM_Core_DAO::executeQuery($sql, array(1 => array($new_pb_id, 'Integer'), 2 => array($id, 'Integer')));
         } catch (Exception $e) {
             CRM_Core_Session::setStatus(ts('Failed to create Progress bar. ') . $e->getMessage(), '', 'error');
             $transaction->rollback();
         }
     } elseif ($action & CRM_Core_Action::DELETE) {
         $errorScope = CRM_Core_TemporaryErrorScope::useException();
         try {
             $transaction = new CRM_Core_Transaction();
             $sql = "DELETE FROM civicrm_wci_progress_bar_formula where progress_bar_id = %1";
             $params = array(1 => array($id, 'Integer'));
             CRM_Core_DAO::executeQuery($sql, $params);
             $sql = "DELETE FROM civicrm_wci_progress_bar where id = %1";
             $params = array(1 => array($id, 'Integer'));
             CRM_Core_DAO::executeQuery($sql, $params);
             $transaction->commit();
         } catch (Exception $e) {
             $errmgs = $e->getMessage() . ts('. Check whether progressbar is used by any widget or not');
             CRM_Core_Session::setStatus($errmgs, '', 'error');
             $transaction->rollback();
         }
     }
     // Example: Set the page-title dynamically; alternatively, declare a static title in xml/Menu/*.xml
     CRM_Utils_System::setTitle(ts('Progress Bar List'));
     $query = "SELECT * FROM civicrm_wci_progress_bar";
     $params = array();
     $dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Wci_DAO_ProgressBar');
     while ($dao->fetch()) {
         $con_page[$dao->id] = array();
         CRM_Core_DAO::storeValues($dao, $con_page[$dao->id]);
         $action = array_sum(array_keys($this->actionLinks()));
         //build the normal action links.
         $con_page[$dao->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action, array('id' => $dao->id));
     }
     if (isset($con_page)) {
         $this->assign('rows', $con_page);
     }
     return parent::run();
 }
开发者ID:Jagadees-zyxware,项目名称:civicrm-wci,代码行数:57,代码来源:ProgressBarList.php

示例4: listParticipations

 /**
  * Function to list participations for the UF user
  *
  * return null
  * @access public
  */
 function listParticipations()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Event_Form_Search', ts('Events'), NULL);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('context', 'user');
     $controller->set('cid', $this->_contactId);
     $controller->set('force', 1);
     $controller->process();
     $controller->run();
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:17,代码来源:UserDashboard.php

示例5: run

 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);
     if ($action & CRM_Core_Action::UPDATE) {
         $controller = new CRM_Core_Controller_Simple('CRM_Wci_Form_CreateWidget', 'Edit Widget', CRM_Core_Action::UPDATE);
         $controller->set('id', $id);
         $controller->process();
         return $controller->run();
     } elseif ($action & CRM_Core_Action::COPY) {
         try {
             $sql = "INSERT INTO civicrm_wci_widget (title, logo_image, image,\n        button_title, button_link_to, progress_bar_id, description,\n        email_signup_group_id, size_variant, color_title, color_title_bg,\n        color_progress_bar, color_progress_bar_bg, color_widget_bg, color_description, color_border,\n        color_button, color_button_bg, hide_title, hide_border, hide_pbcap,\n        color_btn_newsletter, color_btn_newsletter_bg, newsletter_text,\n        color_newsletter_text, style_rules, override, custom_template, show_pb_perc)\n        SELECT concat(title, '-', (SELECT MAX(id) FROM civicrm_wci_widget)), logo_image, image,\n        button_title, button_link_to, progress_bar_id, description,\n        email_signup_group_id, size_variant, color_title, color_title_bg,\n        color_progress_bar, color_progress_bar_bg, color_widget_bg, color_description, color_border,\n        color_button, color_button_bg, hide_title, hide_border, hide_pbcap,\n        color_btn_newsletter, color_btn_newsletter_bg, newsletter_text,\n        color_newsletter_text, style_rules, override, custom_template, show_pb_perc FROM civicrm_wci_widget WHERE id=%1";
             CRM_Core_DAO::executeQuery("SET foreign_key_checks = 0;");
             CRM_Core_DAO::executeQuery($sql, array(1 => array($id, 'Integer')));
             CRM_Core_DAO::executeQuery("SET foreign_key_checks = 1;");
         } catch (Exception $e) {
             CRM_Core_Session::setStatus(ts('Failed to create widget. ') . $e->getMessage(), '', 'error');
             $transaction->rollback();
         }
     } elseif ($action & CRM_Core_Action::DELETE) {
         try {
             $transaction = new CRM_Core_Transaction();
             $sql = "DELETE FROM civicrm_wci_widget where id = %1";
             $params = array(1 => array($id, 'Integer'));
             CRM_Core_DAO::executeQuery($sql, $params);
             $transaction->commit();
         } catch (Exception $e) {
             CRM_Core_Session::setStatus(ts('Failed to delete widget. ') . $e->getMessage(), '', 'error');
             $transaction->rollback();
         }
     }
     CRM_Utils_System::setTitle(ts('Widget List'));
     $query = "SELECT * FROM civicrm_wci_widget";
     $params = array();
     $dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Wci_DAO_Widget');
     while ($dao->fetch()) {
         $wid_page[$dao->id] = array();
         CRM_Core_DAO::storeValues($dao, $wid_page[$dao->id]);
         $wid_page[$dao->id]['title'] = $wid_page[$dao->id]['title'];
         $description = $wid_page[$dao->id]['description'];
         $wid_page[$dao->id]['description'] = strip_tags($description);
         $action = array_sum(array_keys($this->actionLinks()));
         //build the normal action links.
         $wid_page[$dao->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action, array('id' => $dao->id));
     }
     if (isset($wid_page)) {
         $this->assign('rows', $wid_page);
     }
     parent::run();
 }
开发者ID:Jagadees-zyxware,项目名称:civicrm-wci,代码行数:53,代码来源:WidgetList.php

示例6: browse

 /**
  * This function is called when action is browse
  *
  * return null
  * @access public
  */
 function browse()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Tag_Form_Tag', ts('Contact Tags'), $this->_action);
     $controller->setEmbedded(TRUE);
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view', 'action=browse&selectedChild=tag'), FALSE);
     $controller->reset();
     $controller->set('contactId', $this->_contactId);
     $controller->process();
     $controller->run();
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:18,代码来源:Tag.php

示例7: run

 /**
  * This function is the main function that is called when the page loads,
  * it decides the which action has to be taken for the page.
  *
  * return null
  * @access public
  */
 function run()
 {
     $this->preProcess();
     $controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Search', ts('grants'), NULL);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('limit', 10);
     $controller->set('force', 1);
     $controller->set('context', 'dashboard');
     $controller->process();
     $controller->run();
     return parent::run();
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:20,代码来源:DashBoard.php

示例8: edit

 /**
  * This function is called when action is update
  *
  * @param int    $groupID group id
  *
  * return null
  * @access public
  */
 function edit($groupId = NULL)
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_GroupContact', ts('Contact\'s Groups'), $this->_action);
     $controller->setEmbedded(TRUE);
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view', "action=browse&selectedChild=group&cid={$this->_contactId}"), FALSE);
     $controller->reset();
     $controller->set('contactId', $this->_contactId);
     $controller->set('groupId', $groupId);
     $controller->process();
     $controller->run();
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:21,代码来源:GroupContact.php

示例9: edit

 /**
  * This function is called when action is update or new
  *
  * return null
  * @access public
  */
 function edit()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_APIKey', ts('API Key'), $this->_action);
     $controller->setEmbedded(TRUE);
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/contact/view/apikey', 'action=browse&selectedChild=apikey&cid=' . $this->_contactId);
     $session->pushUserContext($url);
     $controller->reset();
     $controller->set('contactId', $this->_contactId);
     $controller->process();
     $controller->run();
 }
开发者ID:Beltline,项目名称:com.cividesk.apikey,代码行数:19,代码来源:APIKey.php

示例10: browse

 /**
  * This function is called when action is browse
  *
  * return null
  * @access public
  */
 function browse()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('cid', $this->_contactId);
     $controller->set('context', 'pledge');
     $controller->process();
     $controller->run();
     if ($this->_contactId) {
         $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
         $this->assign('displayName', $displayName);
     }
 }
开发者ID:hguru,项目名称:224Civi,代码行数:20,代码来源:Tab.php

示例11: listActivities

 /**
  * Function to list participations for the UF user
  *
  * return null
  * @access public
  */
 function listActivities()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_Search', ts('Activities'), NULL, FALSE, FALSE, TRUE, FALSE);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('context', 'user');
     $controller->set('cid', $this->_contactId);
     $controller->set('status', array(1 => 'on', 7 => 'on'));
     $controller->set('activity_role', 2);
     $controller->set('force', 1);
     $controller->process();
     $controller->run();
     return;
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:20,代码来源:UserDashboard.php

示例12: browse

 /**
  * This function is called when action is browse
  * 
  * return null
  * @access public
  */
 function browse()
 {
     require_once 'CRM/Contribute/BAO/Contribution.php';
     // add annual contribution
     $annual = array();
     list($annual['count'], $annual['amount'], $annual['avg']) = CRM_Contribute_BAO_Contribution::annual($this->_contactId);
     $this->assign('annual', $annual);
     $controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Search', ts('Contributions'), $this->_action);
     $controller->setEmbedded(true);
     $controller->reset();
     $controller->set('cid', $this->_contactId);
     $controller->set('id', $this->_id);
     $controller->set('context', 'contribution');
     $controller->process();
     $controller->run();
     //add honor block
     // form all action links
     $action = array_sum(array_keys($this->honorLinks()));
     $params = array();
     $params = CRM_Contribute_BAO_Contribution::getHonorContacts($this->_contactId);
     if (!empty($params)) {
         foreach ($params as $ids => $honorId) {
             $params[$ids]['action'] = CRM_Core_Action::formLink(self::honorLinks(), $action, array('cid' => $honorId['honorId'], 'id' => $ids, 'cxt' => 'contribution', 'contributionType' => $honorId['type_id'], 'honorId' => $this->_contactId));
         }
         // assign vars to templates
         $this->assign('action', $this->_action);
         $this->assign('honorRows', $params);
         $this->assign('honor', true);
     }
     //enable/disable soft credit records for test contribution
     $isTest = 0;
     if (CRM_Utils_Request::retrieve('isTest', 'Positive', $this)) {
         $isTest = 1;
     }
     $this->assign('isTest', $isTest);
     $softCreditList = CRM_Contribute_BAO_Contribution::getSoftContributionList($this->_contactId, $isTest);
     if (!empty($softCreditList)) {
         $softCreditTotals = array();
         list($softCreditTotals['amount'], $softCreditTotals['avg'], $softCreditTotals['currency']) = CRM_Contribute_BAO_Contribution::getSoftContributionTotals($this->_contactId, $isTest);
         $this->assign('softCredit', true);
         $this->assign('softCreditRows', $softCreditList);
         $this->assign('softCreditTotals', $softCreditTotals);
     }
     if ($this->_contactId) {
         require_once 'CRM/Contact/BAO/Contact.php';
         $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
         $this->assign('displayName', $displayName);
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:55,代码来源:Tab.php

示例13: browse

 /**
  * This function is called when action is browse
  *
  * return null
  * @access public
  */
 function browse()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Search', ts('Grants'), $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('cid', $this->_contactId);
     $controller->set('context', 'grant');
     $controller->process();
     $controller->run();
     if ($this->_contactId) {
         $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
         $this->assign('displayName', $displayName);
         $this->ajaxResponse['tabCount'] = CRM_Contact_BAO_Contact::getCountComponent('grant', $this->_contactId);
     }
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:21,代码来源:Tab.php

示例14: interview

 /**
  * @return mixed
  */
 public function interview()
 {
     //build interview and release voter interface.
     $controller = new CRM_Core_Controller_Simple('CRM_Campaign_Form_Task_Interview', ts('Interview Respondents'));
     $controller->set('votingTab', TRUE);
     $controller->set('subVotingTab', 'searchANDInterview');
     if ($this->_surveyId) {
         $controller->set('surveyId', $this->_surveyId);
     }
     if ($this->_interviewerId) {
         $controller->set('interviewerId', $this->_interviewerId);
     }
     $controller->process();
     return $controller->run();
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:18,代码来源:Vote.php

示例15: listActivities

 /**
  * List participations for the UF user.
  *
  * @return bool
  */
 public function listActivities()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_Search', ts('Activities'), NULL, FALSE, FALSE, TRUE, FALSE);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('context', 'user');
     $controller->set('cid', $this->_contactId);
     // Limit to status "Scheduled" and "Available"
     $controller->set('status', array('IN' => array(1, 7)));
     $controller->set('activity_role', 2);
     $controller->set('force', 1);
     $controller->process();
     $controller->run();
     return FALSE;
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:20,代码来源:UserDashboard.php


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