コード例 #1
0
ファイル: Delete.php プロジェクト: FundingWorks/civicrm-core
 /**
  * Build all the data structures needed to build the form.
  */
 public function preProcess()
 {
     if (!CRM_Core_Permission::checkActionPermission('CiviCase', CRM_Core_Action::DELETE)) {
         CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
     }
     parent::preProcess();
 }
コード例 #2
0
ファイル: PDF.php プロジェクト: nielosz/civicrm-core
 /**
  * Build all the data structures needed to build the form.
  */
 public function preProcess()
 {
     $this->skipOnHold = $this->skipDeceased = FALSE;
     parent::preProcess();
     $this->setContactIDs();
     CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
 }
コード例 #3
0
ファイル: SearchTaskHookSample.php プロジェクト: kidaa30/yes
 /**
  * Build all the data structures needed to build the form.
  *
  * @return void
  */
 public function preProcess()
 {
     parent::preProcess();
     $rows = array();
     // display name and email of all contact ids
     $caseIDs = implode(',', $this->_caseIds);
     $statusId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'case_status', 'id', 'name');
     $query = "\nSELECT ct.display_name as display_name,\n       cs.start_date   as start_date,\n       ov.label as status\n\nFROM  civicrm_case cs\nINNER JOIN civicrm_case_contact cc ON ( cs.id = cc.case_id)\nINNER JOIN civicrm_contact ct ON ( cc.contact_id = ct.id)\nLEFT  JOIN civicrm_option_value ov ON (cs.status_id = ov.value AND ov.option_group_id = {$statusId} )\nWHERE cs.id IN ( {$caseIDs} )";
     $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
     while ($dao->fetch()) {
         $rows[] = array('display_name' => $dao->display_name, 'start_date' => CRM_Utils_Date::customFormat($dao->start_date), 'status' => $dao->status);
     }
     $this->assign('rows', $rows);
 }
コード例 #4
0
ファイル: Print.php プロジェクト: prashantgajare/civicrm-core
 /**
  * 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(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_Case_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();
 }
コード例 #5
0
ファイル: Restore.php プロジェクト: hguru/224Civi
 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     parent::preProcess();
 }
コード例 #6
0
ファイル: Select.php プロジェクト: kcristiano/civicrm-core
 /**
  * Build all the data structures needed to build the form.
  *
  * @param
  *
  * @return void
  */
 public function preProcess()
 {
     //special case for custom search, directly give option to download csv file
     $customSearchID = $this->get('customSearchID');
     if ($customSearchID) {
         CRM_Export_BAO_Export::exportCustom($this->get('customSearchClass'), $this->get('formValues'), $this->get(CRM_Utils_Sort::SORT_ORDER));
     }
     $this->_selectAll = FALSE;
     $this->_exportMode = self::CONTACT_EXPORT;
     $this->_componentIds = array();
     $this->_componentClause = NULL;
     // get the submitted values based on search
     if ($this->_action == CRM_Core_Action::ADVANCED) {
         $values = $this->controller->exportValues('Advanced');
     } elseif ($this->_action == CRM_Core_Action::PROFILE) {
         $values = $this->controller->exportValues('Builder');
     } elseif ($this->_action == CRM_Core_Action::COPY) {
         $values = $this->controller->exportValues('Custom');
     } else {
         // we need to determine component export
         $stateMachine = $this->controller->getStateMachine();
         $formName = CRM_Utils_System::getClassName($stateMachine);
         $componentName = explode('_', $formName);
         $components = array('Contribute', 'Member', 'Event', 'Pledge', 'Case', 'Grant', 'Activity');
         if (in_array($componentName[1], $components)) {
             switch ($componentName[1]) {
                 case 'Contribute':
                     $this->_exportMode = self::CONTRIBUTE_EXPORT;
                     break;
                 case 'Member':
                     $this->_exportMode = self::MEMBER_EXPORT;
                     break;
                 case 'Event':
                     $this->_exportMode = self::EVENT_EXPORT;
                     break;
                 case 'Pledge':
                     $this->_exportMode = self::PLEDGE_EXPORT;
                     break;
                 case 'Case':
                     $this->_exportMode = self::CASE_EXPORT;
                     break;
                 case 'Grant':
                     $this->_exportMode = self::GRANT_EXPORT;
                     break;
                 case 'Activity':
                     $this->_exportMode = self::ACTIVITY_EXPORT;
                     break;
             }
             $className = "CRM_{$componentName[1]}_Form_Task";
             $className::preProcessCommon($this, TRUE);
             $values = $this->controller->exportValues('Search');
         } else {
             $values = $this->controller->exportValues('Basic');
         }
     }
     $count = 0;
     $this->_matchingContacts = FALSE;
     if (CRM_Utils_Array::value('radio_ts', $values) == 'ts_sel') {
         foreach ($values as $key => $value) {
             if (strstr($key, 'mark_x')) {
                 $count++;
             }
             if ($count > 2) {
                 $this->_matchingContacts = TRUE;
                 break;
             }
         }
     }
     $componentMode = $this->get('component_mode');
     switch ($componentMode) {
         case 2:
             CRM_Contribute_Form_Task::preProcessCommon($this, TRUE);
             $this->_exportMode = self::CONTRIBUTE_EXPORT;
             $componentName = array('', 'Contribute');
             break;
         case 3:
             CRM_Event_Form_Task::preProcessCommon($this, TRUE);
             $this->_exportMode = self::EVENT_EXPORT;
             $componentName = array('', 'Event');
             break;
         case 4:
             CRM_Activity_Form_Task::preProcessCommon($this, TRUE);
             $this->_exportMode = self::ACTIVITY_EXPORT;
             $componentName = array('', 'Activity');
             break;
         case 5:
             CRM_Member_Form_Task::preProcessCommon($this, TRUE);
             $this->_exportMode = self::MEMBER_EXPORT;
             $componentName = array('', 'Member');
             break;
         case 6:
             CRM_Case_Form_Task::preProcessCommon($this, TRUE);
             $this->_exportMode = self::CASE_EXPORT;
             $componentName = array('', 'Case');
             break;
     }
     $this->_task = $values['task'];
     if ($this->_exportMode == self::CONTACT_EXPORT) {
         $contactTasks = CRM_Contact_Task::taskTitles();
         $taskName = $contactTasks[$this->_task];
         $component = FALSE;
         CRM_Contact_Form_Task::preProcessCommon($this, TRUE);
     } else {
         $this->assign('taskName', "Export {$componentName['1']}");
         $className = "CRM_{$componentName[1]}_Task";
         $componentTasks = $className::tasks();
         $taskName = $componentTasks[$this->_task];
         $component = TRUE;
     }
     if ($this->_componentTable) {
         $query = "\nSELECT count(*)\nFROM   {$this->_componentTable}\n";
         $totalSelectedRecords = CRM_Core_DAO::singleValueQuery($query);
     } else {
         $totalSelectedRecords = count($this->_componentIds);
     }
     $this->assign('totalSelectedRecords', $totalSelectedRecords);
     $this->assign('taskName', $taskName);
     $this->assign('component', $component);
     // all records actions = save a search
     if ($values['radio_ts'] == 'ts_all' || $this->_task == CRM_Contact_Task::SAVE_SEARCH) {
         $this->_selectAll = TRUE;
         $rowCount = $this->get('rowCount');
         if ($rowCount > 2) {
             $this->_matchingContacts = TRUE;
         }
         $this->assign('totalSelectedRecords', $rowCount);
     }
     $this->assign('matchingContacts', $this->_matchingContacts);
     $this->set('componentIds', $this->_componentIds);
     $this->set('selectAll', $this->_selectAll);
     $this->set('exportMode', $this->_exportMode);
     $this->set('componentClause', $this->_componentClause);
     $this->set('componentTable', $this->_componentTable);
 }