• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CRM_Grant_BAO_Grant类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: preProcess

 /**
  * Heart of the viewing process. The runner gets all the meta data for
  * the contact and calls the appropriate type of page to view.
  *
  * @return void
  * @access public
  *
  */
 function preProcess()
 {
     $admin = CRM_Core_Permission::check('administer CiviCRM');
     $grantSummary = CRM_Grant_BAO_Grant::getGrantSummary($admin);
     $this->assign('grantAdmin', $admin);
     $this->assign('grantSummary', $grantSummary);
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:15,代码来源:DashBoard.php


示例2: array

 static function &getFields()
 {
     $fields = array();
     require_once 'CRM/Grant/BAO/Grant.php';
     $fields = CRM_Grant_BAO_Grant::exportableFields();
     return $fields;
 }
开发者ID:bhirsch,项目名称:civicrm,代码行数:7,代码来源:Query.php


示例3: postProcess

 /**
  * process the form after the input has been submitted and validated
  *
  * @access public
  *
  * @return void
  */
 public function postProcess()
 {
     $deletedGrants = 0;
     foreach ($this->_grantIds as $grantId) {
         if (CRM_Grant_BAO_Grant::del($grantId)) {
             $deletedGrants++;
         }
     }
     CRM_Core_Session::setStatus(ts('Deleted Grant(s): %1', array(1 => $deletedGrants)), '', 'info');
     CRM_Core_Session::setStatus(ts('Total Selected Grant(s): %1', array(1 => count($this->_grantIds))), '', 'info');
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:18,代码来源:Delete.php


示例4: postProcess

 /**
  * process the form after the input has been submitted and validated
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     $deletedGrants = 0;
     require_once 'CRM/Grant/BAO/Grant.php';
     foreach ($this->_grantIds as $grantId) {
         if (CRM_Grant_BAO_Grant::del($grantId)) {
             $deletedGrants++;
         }
     }
     $status = array(ts('Deleted Grant(s): %1', array(1 => $deletedGrants)), ts('Total Selected Grant(s): %1', array(1 => count($this->_grantIds))));
     CRM_Core_Session::setStatus($status);
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:18,代码来源:Delete.php


示例5: preProcess

 /**  
  * Function to set variables up before form is built  
  *                                                            
  * @return void  
  * @access public  
  */
 public function preProcess()
 {
     $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->assign('context', $context);
     $values = array();
     $params['id'] = $this->_id;
     require_once 'CRM/Grant/BAO/Grant.php';
     CRM_Grant_BAO_Grant::retrieve($params, $values);
     require_once 'CRM/Grant/PseudoConstant.php';
     $grantType = CRM_Grant_PseudoConstant::grantType();
     $grantStatus = CRM_Grant_PseudoConstant::grantStatus();
     $this->assign('grantType', $grantType[$values['grant_type_id']]);
     $this->assign('grantStatus', $grantStatus[$values['status_id']]);
     $grantTokens = array('amount_total', 'amount_requested', 'amount_granted', 'rationale', 'grant_report_received', 'application_received_date', 'decision_date', 'money_transfer_date', 'grant_due_date');
     foreach ($grantTokens as $token) {
         $this->assign($token, CRM_Utils_Array::value($token, $values));
     }
     if (isset($this->_id)) {
         require_once 'CRM/Core/BAO/Note.php';
         $noteDAO = new CRM_Core_BAO_Note();
         $noteDAO->entity_table = 'civicrm_grant';
         $noteDAO->entity_id = $this->_id;
         if ($noteDAO->find(true)) {
             $this->_noteId = $noteDAO->id;
         }
     }
     if (isset($this->_noteId)) {
         $this->assign('note', CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $this->_noteId, 'note'));
     }
     // add Grant to Recent Items
     require_once 'CRM/Utils/Recent.php';
     require_once 'CRM/Contact/BAO/Contact.php';
     require_once 'CRM/Utils/Money.php';
     $url = CRM_Utils_System::url('civicrm/contact/view/grant', "action=view&reset=1&id={$values['id']}&cid={$values['contact_id']}&context=home");
     $title = CRM_Contact_BAO_Contact::displayName($values['contact_id']) . ' - ' . ts('Grant') . ': ' . CRM_Utils_Money::format($values['amount_total']) . ' (' . $grantType[$values['grant_type_id']] . ')';
     $recentOther = array();
     if (CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::UPDATE)) {
         $recentOther['editUrl'] = CRM_Utils_System::url('civicrm/contact/view/grant', "action=update&reset=1&id={$values['id']}&cid={$values['contact_id']}&context=home");
     }
     if (CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::DELETE)) {
         $recentOther['deleteUrl'] = CRM_Utils_System::url('civicrm/contact/view/grant', "action=delete&reset=1&id={$values['id']}&cid={$values['contact_id']}&context=home");
     }
     CRM_Utils_Recent::add($title, $url, $values['id'], 'Grant', $values['contact_id'], null, $recentOther);
     require_once 'CRM/Core/BAO/File.php';
     $attachment = CRM_Core_BAO_File::attachmentInfo('civicrm_grant', $this->_id);
     $this->assign('attachment', $attachment);
     $groupTree =& CRM_Core_BAO_CustomGroup::getTree("Grant", $this, $this->_id, 0);
     CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
     $this->assign('id', $this->_id);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:58,代码来源:GrantView.php


示例6: postProcess

 /**
  * Process the form after the input has been submitted and validated.
  *
  *
  * @return void
  */
 public function postProcess()
 {
     $deleted = $failed = 0;
     foreach ($this->_grantIds as $grantId) {
         if (CRM_Grant_BAO_Grant::del($grantId)) {
             $deleted++;
         } else {
             $failed++;
         }
     }
     if ($deleted) {
         $msg = ts('%count grant deleted.', array('plural' => '%count grants deleted.', 'count' => $deleted));
         CRM_Core_Session::setStatus($msg, ts('Removed'), 'success');
     }
     if ($failed) {
         CRM_Core_Session::setStatus(ts('1 could not be deleted.', array('plural' => '%count could not be deleted.', 'count' => $failed)), ts('Error'), 'error');
     }
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:24,代码来源:Delete.php


示例7: getCountComponent

 /**
  * Given the component name and returns 
  * the count of participation of contact
  *
  * @param string  $component input component name
  * @param integer $contactId input contact id
  * @param string  $tableName optional tableName if component is custom group
  *
  * @return total number of count of occurence in database
  * @access public
  * @static
  */
 static function getCountComponent($component, $contactId, $tableName = null)
 {
     $object = null;
     switch ($component) {
         case 'tag':
             require_once 'CRM/Core/BAO/EntityTag.php';
             return CRM_Core_BAO_EntityTag::getContactTags($contactId, true);
         case 'rel':
             require_once 'CRM/Contact/BAO/Relationship.php';
             return count(CRM_Contact_BAO_Relationship::getRelationship($contactId));
         case 'group':
             require_once 'CRM/Contact/BAO/GroupContact.php';
             return CRM_Contact_BAO_GroupContact::getContactGroup($contactId, null, null, true);
         case 'log':
             require_once 'CRM/Core/BAO/Log.php';
             return CRM_Core_BAO_Log::getContactLogCount($contactId);
         case 'note':
             require_once 'CRM/Core/BAO/Note.php';
             return CRM_Core_BAO_Note::getContactNoteCount($contactId);
         case 'contribution':
             require_once 'CRM/Contribute/BAO/Contribution.php';
             return CRM_Contribute_BAO_Contribution::contributionCount($contactId);
         case 'membership':
             require_once 'CRM/Member/BAO/Membership.php';
             return CRM_Member_BAO_Membership::getContactMembershipCount($contactId);
         case 'participant':
             require_once 'CRM/Event/BAO/Participant.php';
             return CRM_Event_BAO_Participant::getContactParticipantCount($contactId);
         case 'pledge':
             require_once 'CRM/Pledge/BAO/Pledge.php';
             return CRM_Pledge_BAO_Pledge::getContactPledgeCount($contactId);
         case 'case':
             require_once 'CRM/Case/BAO/Case.php';
             return CRM_Case_BAO_Case::caseCount($contactId);
         case 'grant':
             require_once 'CRM/Grant/BAO/Grant.php';
             return CRM_Grant_BAO_Grant::getContactGrantCount($contactId);
         case 'activity':
             require_once 'CRM/Activity/BAO/Activity.php';
             return CRM_Activity_BAO_Activity::getActivitiesCount($contactId, false, null, null);
         default:
             $custom = explode('_', $component);
             if ($custom['0'] = 'custom') {
                 require_once 'CRM/Core/DAO/CustomGroup.php';
                 if (!$tableName) {
                     $tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $custom['1'], 'table_name');
                 }
                 $queryString = "SELECT count(id) FROM {$tableName} WHERE entity_id = {$contactId}";
                 return CRM_Core_DAO::singleValueQuery($queryString);
             }
     }
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:64,代码来源:Contact.php


示例8: getCountComponent

 /**
  * Given the component name and returns the count of participation of contact.
  *
  * @param string $component
  *   Input component name.
  * @param int $contactId
  *   Input contact id.
  * @param string $tableName
  *   Optional tableName if component is custom group.
  *
  * @return int
  *   total number in database
  */
 public static function getCountComponent($component, $contactId, $tableName = NULL)
 {
     $object = NULL;
     switch ($component) {
         case 'tag':
             return CRM_Core_BAO_EntityTag::getContactTags($contactId, TRUE);
         case 'rel':
             $result = CRM_Contact_BAO_Relationship::getRelationship($contactId, CRM_Contact_BAO_Relationship::CURRENT, 0, 1);
             return $result;
         case 'group':
             return CRM_Contact_BAO_GroupContact::getContactGroup($contactId, "Added", NULL, TRUE);
         case 'log':
             if (CRM_Core_BAO_Log::useLoggingReport()) {
                 return FALSE;
             }
             return CRM_Core_BAO_Log::getContactLogCount($contactId);
         case 'note':
             return CRM_Core_BAO_Note::getContactNoteCount($contactId);
         case 'contribution':
             return CRM_Contribute_BAO_Contribution::contributionCount($contactId);
         case 'membership':
             return CRM_Member_BAO_Membership::getContactMembershipCount($contactId, TRUE);
         case 'participant':
             return CRM_Event_BAO_Participant::getContactParticipantCount($contactId);
         case 'pledge':
             return CRM_Pledge_BAO_Pledge::getContactPledgeCount($contactId);
         case 'case':
             return CRM_Case_BAO_Case::caseCount($contactId);
         case 'grant':
             return CRM_Grant_BAO_Grant::getContactGrantCount($contactId);
         case 'activity':
             $input = array('contact_id' => $contactId, 'admin' => FALSE, 'caseId' => NULL, 'context' => 'activity');
             return CRM_Activity_BAO_Activity::getActivitiesCount($input);
         case 'mailing':
             $params = array('contact_id' => $contactId);
             return CRM_Mailing_BAO_Mailing::getContactMailingsCount($params);
         default:
             $custom = explode('_', $component);
             if ($custom['0'] = 'custom') {
                 if (!$tableName) {
                     $tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $custom['1'], 'table_name');
                 }
                 $queryString = "SELECT count(id) FROM {$tableName} WHERE entity_id = {$contactId}";
                 return CRM_Core_DAO::singleValueQuery($queryString);
             }
     }
 }
开发者ID:JSProffitt,项目名称:civicrm-website-org,代码行数:60,代码来源:Contact.php


示例9: postProcess

 /** 
  * Function to process the form 
  * 
  * @access public 
  * @return None 
  */
 public function postProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         require_once 'CRM/Grant/BAO/Grant.php';
         CRM_Grant_BAO_Grant::del($this->_id);
         return;
     }
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $ids['grant'] = $this->_id;
     }
     // get the submitted form values.
     $params = $this->controller->exportValues($this->_name);
     if (!$params['grant_report_received']) {
         $params['grant_report_received'] = "null";
     }
     // set the contact, when contact is selected
     if (CRM_Utils_Array::value('contact_select_id', $params)) {
         $this->_contactID = $params['contact_select_id'][1];
     }
     $params['contact_id'] = $this->_contactID;
     $dates = array('application_received_date', 'decision_date', 'money_transfer_date', 'grant_due_date');
     foreach ($dates as $d) {
         $params[$d] = CRM_Utils_Date::processDate($params[$d], null, true);
     }
     $ids['note'] = array();
     if ($this->_noteId) {
         $ids['note']['id'] = $this->_noteId;
     }
     // process custom data
     $customFields = CRM_Core_BAO_CustomField::getFields('Grant');
     $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $customFields, $this->_id, 'Grant');
     // add attachments as needed
     CRM_Core_BAO_File::formatAttachment($params, $params, 'civicrm_grant', $this->_id);
     require_once 'CRM/Grant/BAO/Grant.php';
     $grant = CRM_Grant_BAO_Grant::create($params, $ids);
     $buttonName = $this->controller->getButtonName();
     $session = CRM_Core_Session::singleton();
     if ($this->_context == 'standalone') {
         if ($buttonName == $this->getButtonName('upload', 'new')) {
             $session->replaceUserContext(CRM_Utils_System::url('civicrm/grant/add', 'reset=1&action=add&context=standalone'));
         } else {
             $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->_contactID}&selectedChild=grant"));
         }
     } else {
         if ($buttonName == $this->getButtonName('upload', 'new')) {
             $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view/grant', "reset=1&action=add&context=grant&cid={$this->_contactID}"));
         }
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:55,代码来源:Grant.php


示例10: array

 static function &getFields()
 {
     $fields = array();
     $fields = CRM_Grant_BAO_Grant::exportableFields();
     return $fields;
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:6,代码来源:Query.php


示例11: setContext

 function setContext()
 {
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->_id = CRM_Utils_Request::retrieve('id', 'Integer', $this);
     $session = CRM_Core_Session::singleton();
     $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
     //validate the qfKey
     if (!CRM_Utils_Rule::qfKey($qfKey)) {
         $qfKey = NULL;
     }
     switch ($context) {
         case 'search':
             $urlParams = 'force=1';
             if ($qfKey) {
                 $urlParams .= "&qfKey={$qfKey}";
             }
             $this->assign('searchKey', $qfKey);
             $url = CRM_Utils_System::url('civicrm/grant/search', $urlParams);
             break;
         case 'dashboard':
             $url = CRM_Utils_System::url('civicrm/grant', 'reset=1');
             break;
         case 'edit':
             $url = CRM_utils_System::url('civicrm/contact/view/grant', 'reset=1&id=' . $this->_id . '&cid=' . $this->_contactId . '&action=view&context=grant&selectedChild=grant');
             break;
         case 'grant':
             $url = CRM_Utils_System::url('civicrm/contact/view', 'action=browse&selectedChild=grant&cid=' . $this->_contactId);
             break;
         case 'standalone':
             $url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
             break;
         default:
             $cid = NULL;
             if ($this->_contactId) {
                 $cid = '&cid=' . $this->_contactId;
             }
             $url = CRM_Utils_System::url('civicrm/grant/search', 'reset=1&force=1' . $cid);
             break;
     }
     $session->pushUserContext($url);
     if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', CRM_Core_DAO::$_nullObject)) {
         CRM_Grant_BAO_Grant::del($this->_id);
         CRM_Utils_System::redirect($url);
     }
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:45,代码来源:Tab.php


示例12: postProcess

 /**
  * process the form after the input has been submitted and validated
  *
  * @access public
  *
  * @return void
  */
 public function postProcess()
 {
     $updatedGrants = 0;
     // get the submitted form values.
     $params = $this->controller->exportValues($this->_name);
     $qfKey = $params['qfKey'];
     foreach ($params as $key => $value) {
         if ($value == '' || $key == 'qfKey') {
             unset($params[$key]);
         }
     }
     if (!empty($params)) {
         foreach ($params as $key => $value) {
             $values[$key] = $value;
         }
         foreach ($this->_grantIds as $grantId) {
             $ids['grant_id'] = $grantId;
             CRM_Grant_BAO_Grant::add($values, $ids);
             $updatedGrants++;
         }
     }
     $status = ts('Updated Grant(s): %1 (Total Selected: %2)', array(1 => $updatedGrants, 2 => count($this->_grantIds)));
     CRM_Core_Session::setStatus($status, '', 'info');
     CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/grant/search', 'force=1&qfKey=' . $qfKey));
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:32,代码来源:Update.php


示例13: setContext

 function setContext()
 {
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->_id = CRM_Utils_Request::retrieve('id', 'Integer', $this);
     $session =& CRM_Core_Session::singleton();
     switch ($context) {
         case 'search':
             $url = CRM_Utils_System::url('civicrm/grant/search', 'force=1');
             break;
         case 'dashboard':
             $url = CRM_Utils_System::url('civicrm/grant', 'reset=1');
             break;
         case 'edit':
             $url = CRM_utils_System::url('civicrm/contact/view/grant', 'reset=1&id=' . $this->_id . '&cid=' . $this->_contactId . '&action=view&context=grant&selectedChild=grant');
             break;
         case 'grant':
             $url = CRM_Utils_System::url('civicrm/contact/view', 'action=browse&selectedChild=grant&cid=' . $this->_contactId);
             break;
         case 'standalone':
             $url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
             break;
         default:
             $cid = null;
             if ($this->_contactId) {
                 $cid = '&cid=' . $this->_contactId;
             }
             $url = CRM_Utils_System::url('civicrm/grant/search', 'reset=1&force=1' . $cid);
             break;
     }
     $session->pushUserContext($url);
     if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', CRM_Core_DAO::$_nullObject)) {
         require_once 'CRM/Grant/BAO/Grant.php';
         CRM_Grant_BAO_Grant::del($this->_id);
         CRM_Utils_System::redirect($url);
     }
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:36,代码来源:Tab.php


示例14: getGrantStatuses

 static function getGrantStatuses()
 {
     $og = CRM_Grant_BAO_Grant::getGrantStatusOptGroup();
     require_once 'CRM/Core/BAO/OptionValue.php';
     $dao = new CRM_Core_DAO_OptionValue();
     $dao->option_group_id = $og->id;
     $dao->find();
     $statuses = array();
     while ($dao->fetch()) {
         $statuses[$dao->id] = $dao->label;
     }
     return $statuses;
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:13,代码来源:Grant.php


示例15: buildMappingForm


//.........这里部分代码省略.........
                 foreach (CRM_Export_BAO_Export::componentPaymentFields() as $payField => $payTitle) {
                     $componentPaymentFields[$payField] = array('title' => $payTitle);
                 }
                 $fields['Participant'] = array_merge($fields['Participant'], $componentPaymentFields);
             }
             $compArray['Participant'] = ts('Participant');
         }
     }
     if ($mappingType == 'Search Builder' || $exportMode == CRM_Export_Form_Select::MEMBER_EXPORT) {
         if (CRM_Core_Permission::access('CiviMember')) {
             $fields['Membership'] = CRM_Member_BAO_Membership::getMembershipFields($exportMode);
             unset($fields['Membership']['membership_contact_id']);
             $compArray['Membership'] = ts('Membership');
         }
     }
     if ($mappingType == 'Search Builder' || $exportMode == CRM_Export_Form_Select::PLEDGE_EXPORT) {
         if (CRM_Core_Permission::access('CiviPledge')) {
             $fields['Pledge'] = CRM_Pledge_BAO_Pledge::exportableFields();
             unset($fields['Pledge']['pledge_contact_id']);
             $compArray['Pledge'] = ts('Pledge');
         }
     }
     if ($mappingType == 'Search Builder' || $exportMode == CRM_Export_Form_Select::CASE_EXPORT) {
         if (CRM_Core_Permission::access('CiviCase')) {
             $fields['Case'] = CRM_Case_BAO_Case::exportableFields();
             $compArray['Case'] = ts('Case');
             $fields['Activity'] = CRM_Activity_BAO_Activity::exportableFields('Case');
             $compArray['Activity'] = ts('Case Activity');
             unset($fields['Case']['case_contact_id']);
         }
     }
     if ($mappingType == 'Search Builder' || $exportMode == CRM_Export_Form_Select::GRANT_EXPORT) {
         if (CRM_Core_Permission::access('CiviGrant')) {
             $fields['Grant'] = CRM_Grant_BAO_Grant::exportableFields();
             unset($fields['Grant']['grant_contact_id']);
             if ($mappingType == 'Search Builder') {
                 unset($fields['Grant']['grant_type_id']);
             }
             $compArray['Grant'] = ts('Grant');
         }
     }
     if ($mappingType == 'Search Builder' || $exportMode == CRM_Export_Form_Select::ACTIVITY_EXPORT) {
         $fields['Activity'] = CRM_Activity_BAO_Activity::exportableFields('Activity');
         $compArray['Activity'] = ts('Activity');
     }
     //Contact Sub Type For export
     $contactSubTypes = array();
     $subTypes = CRM_Contact_BAO_ContactType::subTypeInfo();
     foreach ($subTypes as $subType => $val) {
         //adding subtype specific relationships CRM-5256
         $csRelationships = array();
         if ($mappingType == 'Export') {
             $subTypeRelationshipTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'], FALSE, 'label', TRUE, $subType);
             foreach ($subTypeRelationshipTypes as $key => $var) {
                 if (!array_key_exists($key, $fields[$val['parent']])) {
                     list($type) = explode('_', $key);
                     $csRelationships[$key]['title'] = $var;
                     $csRelationships[$key]['headerPattern'] = '/' . preg_quote($var, '/') . '/';
                     $csRelationships[$key]['export'] = TRUE;
                     $csRelationships[$key]['relationship_type_id'] = $type;
                     $csRelationships[$key]['related'] = TRUE;
                     $csRelationships[$key]['hasRelationType'] = 1;
                 }
             }
         }
         $fields[$subType] = $fields[$val['parent']] + $csRelationships;
开发者ID:riyadennis,项目名称:my_civicrm,代码行数:67,代码来源:Mapping.php


示例16: postProcess

 /**
  * Function to process the form
  *
  * @access public
  *
  * @return void
  */
 public function postProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         CRM_Grant_BAO_Grant::del($this->_id);
         return;
     }
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $ids['grant_id'] = $this->_id;
     }
     // get the submitted form values.
     $params = $this->controller->exportValues($this->_name);
     if (empty($params['grant_report_received'])) {
         $params['grant_report_received'] = "null";
     }
     // set the contact, when contact is selected
     if ($this->_context == 'standalone') {
         $this->_contactID = $params['contact_id'];
     }
     $params['contact_id'] = $this->_contactID;
     $ids['note'] = array();
     if ($this->_noteId) {
         $ids['note']['id'] = $this->_noteId;
     }
     // build custom data getFields array
     $customFieldsGrantType = CRM_Core_BAO_CustomField::getFields('Grant', FALSE, FALSE, CRM_Utils_Array::value('grant_type_id', $params));
     $customFields = CRM_Utils_Array::crmArrayMerge($customFieldsGrantType, CRM_Core_BAO_CustomField::getFields('Grant', FALSE, FALSE, NULL, NULL, TRUE));
     $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $customFields, $this->_id, 'Grant');
     // add attachments as needed
     CRM_Core_BAO_File::formatAttachment($params, $params, 'civicrm_grant', $this->_id);
     $grant = CRM_Grant_BAO_Grant::create($params, $ids);
     $buttonName = $this->controller->getButtonName();
     $session = CRM_Core_Session::singleton();
     if ($this->_context == 'standalone') {
         if ($buttonName == $this->getButtonName('upload', 'new')) {
             $session->replaceUserContext(CRM_Utils_System::url('civicrm/grant/add', 'reset=1&action=add&context=standalone'));
         } else {
             $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->_contactID}&selectedChild=grant"));
         }
     } elseif ($buttonName == $this->getButtonName('upload', 'new')) {
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view/grant', "reset=1&action=add&context=grant&cid={$this->_contactID}"));
     }
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:49,代码来源:Grant.php


示例17: array

 /**
  * combine all the exportable fields from the lower levels object
  *     
  * @return array array of exportable Fields
  * @access public
  */
 function &exportableFields()
 {
     if (!self::$_exportableFields) {
         if (!self::$_exportableFields) {
             self::$_exportableFields = array();
         }
         require_once 'CRM/Grant/DAO/Grant.php';
         $fields = CRM_Grant_DAO_Grant::export();
         $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Grant'));
         self::$_exportableFields = $fields;
     }
     return self::$_exportableFields;
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:19,代码来源:Grant.php


示例18: array

 /**
  * Combine all the exportable fields from the lower levels object.
  *
  * @return array
  *   array of exportable Fields
  */
 public static function &exportableFields()
 {
     if (!self::$_exportableFields) {
         if (!self::$_exportableFields) {
             self::$_exportableFields = array();
         }
         $grantFields = array('grant_status' => array('title' => 'Grant Status', 'name' => 'grant_status', 'data_type' => CRM_Utils_Type::T_STRING), 'grant_type' => array('title' => 'Grant Type', 'name' => 'grant_type', 'data_type' => CRM_Utils_Type::T_STRING), 'grant_money_transfer_date' => array('title' => 'Grant Money Transfer Date', 'name' => 'grant_money_transfer_date', 'data_type' => CRM_Utils_Type::T_DATE), 'grant_amount_requested' => array('title' => 'Grant Amount Requested', 'name' => 'grant_amount_requested', 'data_type' => CRM_Utils_Type::T_FLOAT), 'grant_application_received_date' => array('title' => 'Grant Application Received Date', 'name' => 'grant_application_received_date', 'data_type' => CRM_Utils_Type::T_DATE));
         $fields = CRM_Grant_DAO_Grant::export();
         $grantNote = array('grant_note' => array('title' => ts('Grant Note'), 'name' => 'grant_note', 'data_type' => CRM_Utils_Type::T_TEXT));
         $fields = array_merge($fields, $grantFields, $grantNote, CRM_Core_BAO_CustomField::getFieldsForImport('Grant'));
         self::$_exportableFields = $fields;
     }
     return self::$_exportableFields;
 }
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:20,代码来源:Grant.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CRM_Logging_Schema类代码示例发布时间:2022-05-20
下一篇:
PHP CRM_Financial_DAO_FinancialType类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap