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


PHP CRM_Campaign_PseudoConstant::campaignType方法代码示例

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


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

示例1: buildQuickForm

 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     if ($this->_search) {
         return;
     }
     $attributes = CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Campaign');
     $this->add('text', 'campaign_title', ts('Title'), $attributes['title']);
     //campaign description.
     $this->add('text', 'description', ts('Description'), $attributes['description']);
     //campaign start date.
     $this->addDate('start_date', ts('From'), FALSE, array('formatType' => 'searchDate'));
     //campaign end date.
     $this->addDate('end_date', ts('To'), FALSE, array('formatType' => 'searchDate'));
     //campaign type.
     $campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
     $this->add('select', 'campaign_type_id', ts('Campaign Type'), array('' => ts('- select -')) + $campaignTypes);
     $this->set('campaignTypes', $campaignTypes);
     $this->assign('campaignTypes', json_encode($campaignTypes));
     //campaign status
     $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
     $this->addElement('select', 'status_id', ts('Campaign Status'), array('' => ts('- select -')) + $campaignStatus);
     $this->set('campaignStatus', $campaignStatus);
     $this->assign('campaignStatus', json_encode($campaignStatus));
     //active campaigns
     $this->addElement('select', 'is_active', ts('Is Active?'), array('' => ts('- select -'), '0' => ts('Yes'), '1' => ts('No')));
     //build the array of all search params.
     $this->_searchParams = array();
     foreach ($this->_elements as $element) {
         $name = $element->_attributes['name'];
         $label = $element->_label;
         if ($name == 'qfKey') {
             continue;
         }
         $this->_searchParams[$name] = $label ? $label : $name;
     }
     $this->set('searchParams', $this->_searchParams);
     $this->assign('searchParams', json_encode($this->_searchParams));
 }
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:41,代码来源:Campaign.php

示例2: browse

 /**
  * Browse all custom data groups.
  *
  * @param string $action   the action to be invoked
  *
  * @return void
  * @access public
  */
 function browse($action = NULL)
 {
     // get all custom groups sorted by weight
     $customGroup = array();
     $dao = new CRM_Core_DAO_CustomGroup();
     $dao->orderBy('weight, title');
     $dao->find();
     while ($dao->fetch()) {
         $customGroup[$dao->id] = array();
         CRM_Core_DAO::storeValues($dao, $customGroup[$dao->id]);
         // form all action links
         $action = array_sum(array_keys($this->actionLinks()));
         // update enable/disable links depending on custom_group properties.
         if ($dao->is_active) {
             $action -= CRM_Core_Action::ENABLE;
         } else {
             $action -= CRM_Core_Action::DISABLE;
         }
         $customGroup[$dao->id]['order'] = $customGroup[$dao->id]['weight'];
         $customGroup[$dao->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action, array('id' => $dao->id));
     }
     $customGroupExtends = CRM_Core_SelectValues::customGroupExtends();
     foreach ($customGroup as $key => $array) {
         CRM_Core_DAO_CustomGroup::addDisplayEnums($customGroup[$key]);
         $customGroup[$key]['extends_display'] = $customGroupExtends[$customGroup[$key]['extends']];
     }
     //fix for Displaying subTypes
     $subTypes = array();
     $subTypes['Activity'] = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
     $subTypes['Contribution'] = CRM_Contribute_PseudoConstant::contributionType();
     $subTypes['Membership'] = CRM_Member_BAO_MembershipType::getMembershipTypes(FALSE);
     $subTypes['Event'] = CRM_Core_OptionGroup::values('event_type');
     $subTypes['Grant'] = CRM_Core_OptionGroup::values('grant_type');
     $subTypes['Campaign'] = CRM_Campaign_PseudoConstant::campaignType();
     $subTypes['Participant'] = array();
     $subTypes['ParticipantRole'] = CRM_Core_OptionGroup::values('participant_role');
     $subTypes['ParticipantEventName'] = CRM_Event_PseudoConstant::event();
     $subTypes['ParticipantEventType'] = CRM_Core_OptionGroup::values('event_type');
     $subTypes['Individual'] = CRM_Contact_BAO_ContactType::subTypePairs('Individual', FALSE, NULL);
     $subTypes['Household'] = CRM_Contact_BAO_ContactType::subTypePairs('Household', FALSE, NULL);
     $subTypes['Organization'] = CRM_Contact_BAO_ContactType::subTypePairs('Organization', FALSE, NULL);
     $relTypeInd = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Individual');
     $relTypeOrg = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Organization');
     $relTypeHou = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Household');
     $allRelationshipType = array();
     $allRelationshipType = array_merge($relTypeInd, $relTypeOrg);
     $allRelationshipType = array_merge($allRelationshipType, $relTypeHou);
     //adding subtype specific relationships CRM-5256
     $relSubType = CRM_Contact_BAO_ContactType::subTypeInfo();
     foreach ($relSubType as $subType => $val) {
         $subTypeRelationshipTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'], FALSE, 'label', TRUE, $subType);
         $allRelationshipType = array_merge($allRelationshipType, $subTypeRelationshipTypes);
     }
     $subTypes['Relationship'] = $allRelationshipType;
     $cSubTypes = CRM_Core_Component::contactSubTypes();
     $contactSubTypes = array();
     foreach ($cSubTypes as $key => $value) {
         $contactSubTypes[$key] = $key;
     }
     $subTypes['Contact'] = $contactSubTypes;
     CRM_Core_BAO_CustomGroup::getExtendedObjectTypes($subTypes);
     foreach ($customGroup as $key => $values) {
         $subValue = CRM_Utils_Array::value('extends_entity_column_value', $customGroup[$key]);
         $subName = CRM_Utils_Array::value('extends_entity_column_id', $customGroup[$key]);
         $type = CRM_Utils_Array::value('extends', $customGroup[$key]);
         if ($subValue) {
             $subValue = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($subValue, 1, -1));
             $colValue = NULL;
             foreach ($subValue as $sub) {
                 if ($sub) {
                     if ($type == 'Participant') {
                         if ($subName == 1) {
                             $colValue = $colValue ? $colValue . ', ' . $subTypes['ParticipantRole'][$sub] : $subTypes['ParticipantRole'][$sub];
                         } elseif ($subName == 2) {
                             $colValue = $colValue ? $colValue . ', ' . $subTypes['ParticipantEventName'][$sub] : $subTypes['ParticipantEventName'][$sub];
                         } elseif ($subName == 3) {
                             $colValue = $colValue ? $colValue . ', ' . $subTypes['ParticipantEventType'][$sub] : $subTypes['ParticipantEventType'][$sub];
                         }
                     } elseif ($type == 'Relationship') {
                         $colValue = $colValue ? $colValue . ', ' . $subTypes[$type][$sub . '_a_b'] : $subTypes[$type][$sub . '_a_b'];
                         if (isset($subTypes[$type][$sub . '_b_a'])) {
                             $colValue = $colValue ? $colValue . ', ' . $subTypes[$type][$sub . '_b_a'] : $subTypes[$type][$sub . '_b_a'];
                         }
                     } else {
                         $colValue = $colValue ? $colValue . (isset($subTypes[$type][$sub]) ? ', ' . $subTypes[$type][$sub] : '') : (isset($subTypes[$type][$sub]) ? $subTypes[$type][$sub] : '');
                     }
                 }
             }
             $customGroup[$key]["extends_entity_column_value"] = $colValue;
         } else {
             if (is_array(CRM_Utils_Array::value($type, $subTypes))) {
                 $customGroup[$key]["extends_entity_column_value"] = ts("Any");
//.........这里部分代码省略.........
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:101,代码来源:Group.php

示例3: getCampaignSummary

 /**
  * @param array $params
  *
  * @return array
  */
 public static function getCampaignSummary($params = array())
 {
     $campaignsData = array();
     //get the campaigns.
     $campaigns = CRM_Campaign_BAO_Campaign::getCampaignSummary($params);
     if (!empty($campaigns)) {
         $config = CRM_Core_Config::singleton();
         $campaignType = CRM_Campaign_PseudoConstant::campaignType();
         $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
         $properties = array('id', 'name', 'title', 'status_id', 'description', 'campaign_type_id', 'is_active', 'start_date', 'end_date');
         foreach ($campaigns as $cmpid => $campaign) {
             foreach ($properties as $prop) {
                 $campaignsData[$cmpid][$prop] = CRM_Utils_Array::value($prop, $campaign);
             }
             $statusId = CRM_Utils_Array::value('status_id', $campaign);
             $campaignsData[$cmpid]['status'] = CRM_Utils_Array::value($statusId, $campaignStatus);
             $campaignsData[$cmpid]['campaign_id'] = $campaign['id'];
             $campaignsData[$cmpid]['campaign_type'] = $campaignType[$campaign['campaign_type_id']];
             $action = array_sum(array_keys(self::campaignActionLinks()));
             if ($campaign['is_active']) {
                 $action -= CRM_Core_Action::ENABLE;
             } else {
                 $action -= CRM_Core_Action::DISABLE;
             }
             $isActive = ts('No');
             if ($campaignsData[$cmpid]['is_active']) {
                 $isActive = ts('Yes');
             }
             $campaignsData[$cmpid]['isActive'] = $isActive;
             if (!empty($campaignsData[$cmpid]['start_date'])) {
                 $campaignsData[$cmpid]['start_date'] = CRM_Utils_Date::customFormat($campaignsData[$cmpid]['start_date'], $config->dateformatFull);
             }
             if (!empty($campaignsData[$cmpid]['end_date'])) {
                 $campaignsData[$cmpid]['end_date'] = CRM_Utils_Date::customFormat($campaignsData[$cmpid]['end_date'], $config->dateformatFull);
             }
             $campaignsData[$cmpid]['action'] = CRM_Core_Action::formLink(self::campaignActionLinks(), $action, array('id' => $campaign['id']), ts('more'), FALSE, 'campaign.dashboard.row', 'Campaign', $campaign['id']);
         }
     }
     return $campaignsData;
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:45,代码来源:DashBoard.php

示例4: buildQuickForm

 /**
  * Build the form object.
  *
  *
  * @return void
  */
 public function buildQuickForm()
 {
     $this->applyFilter('__ALL__', 'trim');
     $attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_CustomGroup');
     //title
     $this->add('text', 'title', ts('Set Name'), $attributes['title'], TRUE);
     //Fix for code alignment, CRM-3058
     $contactTypes = array('Contact', 'Individual', 'Household', 'Organization');
     $this->assign('contactTypes', json_encode($contactTypes));
     $sel1 = array("" => ts("- select -")) + CRM_Core_SelectValues::customGroupExtends();
     $sel2 = array();
     $activityType = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
     $eventType = CRM_Core_OptionGroup::values('event_type');
     $grantType = CRM_Core_OptionGroup::values('grant_type');
     $campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
     $membershipType = CRM_Member_BAO_MembershipType::getMembershipTypes(FALSE);
     $participantRole = CRM_Core_OptionGroup::values('participant_role');
     $relTypeInd = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Individual');
     $relTypeOrg = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Organization');
     $relTypeHou = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Household');
     ksort($sel1);
     asort($activityType);
     asort($eventType);
     asort($grantType);
     asort($membershipType);
     asort($participantRole);
     $allRelationshipType = array();
     $allRelationshipType = array_merge($relTypeInd, $relTypeOrg);
     $allRelationshipType = array_merge($allRelationshipType, $relTypeHou);
     //adding subtype specific relationships CRM-5256
     $subTypes = CRM_Contact_BAO_ContactType::subTypeInfo();
     foreach ($subTypes as $subType => $val) {
         $subTypeRelationshipTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'], FALSE, 'label', TRUE, $subType);
         $allRelationshipType = array_merge($allRelationshipType, $subTypeRelationshipTypes);
     }
     $sel2['Event'] = $eventType;
     $sel2['Grant'] = $grantType;
     $sel2['Activity'] = $activityType;
     $sel2['Campaign'] = $campaignTypes;
     $sel2['Membership'] = $membershipType;
     $sel2['ParticipantRole'] = $participantRole;
     $sel2['ParticipantEventName'] = CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
     $sel2['ParticipantEventType'] = $eventType;
     $sel2['Contribution'] = CRM_Contribute_PseudoConstant::financialType();
     $sel2['Relationship'] = $allRelationshipType;
     $sel2['Individual'] = CRM_Contact_BAO_ContactType::subTypePairs('Individual', FALSE, NULL);
     $sel2['Household'] = CRM_Contact_BAO_ContactType::subTypePairs('Household', FALSE, NULL);
     $sel2['Organization'] = CRM_Contact_BAO_ContactType::subTypePairs('Organization', FALSE, NULL);
     CRM_Core_BAO_CustomGroup::getExtendedObjectTypes($sel2);
     foreach ($sel2 as $main => $sub) {
         if (!empty($sel2[$main])) {
             if ($main == 'Relationship') {
                 $relName = self::getFormattedList($sel2[$main]);
                 $sel2[$main] = array('' => ts("- Any -")) + $relName;
             } else {
                 $sel2[$main] = array('' => ts("- Any -")) + $sel2[$main];
             }
         }
     }
     $cSubTypes = CRM_Core_Component::contactSubTypes();
     if (!empty($cSubTypes)) {
         $contactSubTypes = array();
         foreach ($cSubTypes as $key => $value) {
             $contactSubTypes[$key] = $key;
         }
         $sel2['Contact'] = array("" => "- Any -") + $contactSubTypes;
     } else {
         if (!isset($this->_id)) {
             $formName = 'document.forms.' . $this->_name;
             $js = "<script type='text/javascript'>\n";
             $js .= "{$formName}['extends_1'].style.display = 'none';\n";
             $js .= "</script>";
             $this->assign('initHideBlocks', $js);
         }
     }
     $sel =& $this->add('hierselect', 'extends', ts('Used For'), array('name' => 'extends[0]', 'style' => 'vertical-align: top;'), TRUE);
     $sel->setOptions(array($sel1, $sel2));
     if (is_a($sel->_elements[1], 'HTML_QuickForm_select')) {
         // make second selector a multi-select -
         $sel->_elements[1]->setMultiple(TRUE);
         $sel->_elements[1]->setSize(5);
     }
     if ($this->_action == CRM_Core_Action::UPDATE) {
         $subName = CRM_Utils_Array::value('extends_entity_column_id', $this->_defaults);
         if ($this->_defaults['extends'] == 'Participant') {
             if ($subName == 1) {
                 $this->_defaults['extends'] = 'ParticipantRole';
             } elseif ($subName == 2) {
                 $this->_defaults['extends'] = 'ParticipantEventName';
             } elseif ($subName == 3) {
                 $this->_defaults['extends'] = 'ParticipantEventType';
             }
         }
         //allow to edit settings if custom set is empty CRM-5258
//.........这里部分代码省略.........
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:101,代码来源:Group.php

示例5: asort

 /**
  * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
  * Get all campaign types.
  *
  * The static array campaignType is returned
  *
  *
  * @return array
  *   array reference of all campaign types.
  */
 public static function &campaignType()
 {
     if (!self::$campaignType) {
         self::$campaignType = CRM_Core_OptionGroup::values('campaign_type');
     }
     asort(self::$campaignType);
     return self::$campaignType;
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:18,代码来源:PseudoConstant.php

示例6: buildQuickForm

 public function buildQuickForm()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Delete'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     if ($this->_cdType) {
         return CRM_Custom_Form_CustomData::buildQuickForm($this);
     }
     //campaign types.
     $campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
     //lets assign custom data type and subtype.
     $this->assign('customDataType', 'Campaign');
     $this->assign('entityID', $this->_campaignId);
     $this->assign('customDataSubType', CRM_Utils_Array::value('campaign_type_id', $this->_values));
     $attributes = CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Campaign');
     // add comaign title.
     $this->add('text', 'title', ts('Title'), $attributes['title'], TRUE);
     // add description
     $this->add('textarea', 'description', ts('Description'), $attributes['description']);
     // add campaign start date
     $this->addDateTime('start_date', ts('Start Date'), TRUE, array('formatType' => 'activityDateTime'));
     // add campaign end date
     $this->addDateTime('end_date', ts('End Date'), FALSE, array('formatType' => 'activityDateTime'));
     // add campaign type
     $this->add('select', 'campaign_type_id', ts('Campaign Type'), array('' => ts('- select -')) + $campaignTypes, TRUE, array('onChange' => "buildCustomData( 'Campaign', this.value );"));
     // add campaign status
     $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
     $this->addElement('select', 'status_id', ts('Campaign Status'), array('' => ts('- select -')) + $campaignStatus);
     // add External Identifire Element
     $this->add('text', 'external_identifier', ts('External Id'), CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Campaign', 'external_identifier'), FALSE);
     // add Campaign Parent Id
     $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(CRM_Utils_Array::value('parent_id', $this->_values), $this->_campaignId);
     if (!empty($campaigns)) {
         $this->addElement('select', 'parent_id', ts('Parent Id'), array('' => ts('- select Parent -')) + $campaigns);
     }
     //get the campaign groups.
     $groups = CRM_Core_PseudoConstant::group('Campaign');
     $inG =& $this->addElement('advmultiselect', 'includeGroups', ts('Include Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
     $inG->setButtonAttributes('add', array('value' => ts('Add >>')));
     $inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
     $this->addWysiwyg('goal_general', ts('Campaign Goals'), array('rows' => 2, 'cols' => 40));
     $this->add('text', 'goal_revenue', ts('Revenue Goal'), array('size' => 8, 'maxlength' => 12));
     $this->addRule('goal_revenue', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
     // is this Campaign active
     $this->addElement('checkbox', 'is_active', ts('Is Active?'));
     $this->addButtons(array(array('type' => 'upload', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'upload', 'name' => ts('Save and New'), 'subName' => 'new'), array('type' => 'cancel', 'name' => ts('Cancel'))));
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:49,代码来源:Campaign.php

示例7:

 /**
  * Get all campaign types.
  *
  * The static array campaignType is returned
  *
  * @access public
  * @static
  * @return array - array reference of all campaign types.
  *
  */
 public static function &campaignType()
 {
     if (!self::$campaignType) {
         require_once 'CRM/Core/OptionGroup.php';
         self::$campaignType = CRM_Core_OptionGroup::values('campaign_type');
     }
     return self::$campaignType;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:18,代码来源:PseudoConstant.php

示例8: buildQuickForm

 public function buildQuickForm()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Delete'), 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     $attributes = CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Campaign');
     // add comaign title.
     $this->add('text', 'title', ts('Title'), $attributes['title'], true);
     // add description
     $this->add('textarea', 'description', ts('Description'), $attributes['description']);
     // add campaign start date
     $this->addDateTime('start_date', ts('Start Date'), true, array('formatType' => 'activityDateTime'));
     // add campaign end date
     $this->addDateTime('end_date', ts('End Date'), false, array('formatType' => 'activityDateTime'));
     // add campaign type
     $campaignType = CRM_Campaign_PseudoConstant::campaignType();
     $this->add('select', 'campaign_type_id', ts('Campaign Type'), array('' => ts('- select -')) + $campaignType, true);
     // add campaign status
     $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
     $this->addElement('select', 'status_id', ts('Campaign Status'), array('' => ts('- select -')) + $campaignStatus);
     // add External Identifire Element
     $this->add('text', 'external_identifier', ts('External Id'), CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Campaign', 'external_identifier'), false);
     // add Campaign Parent Id
     require_once 'CRM/Campaign/BAO/Campaign.php';
     $campaigns = CRM_Campaign_BAO_Campaign::getAllCampaign($this->_campaignId);
     if ($campaigns) {
         $this->addElement('select', 'parent_id', ts('Parent Id'), array('' => ts('- select Parent -')) + $campaigns);
     }
     //get the campaign groups.
     $groups = CRM_Core_PseudoConstant::group('Campaign');
     $inG =& $this->addElement('advmultiselect', 'includeGroups', ts('Include Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
     $inG->setButtonAttributes('add', array('value' => ts('Add >>')));
     $inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
     // is this Campaign active
     $this->addElement('checkbox', 'is_active', ts('Is Active?'));
     if ($this->_context == 'dialog') {
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'), 'js' => array('onclick' => "cj('#campaign-dialog').dialog('close'); return false;"))));
     } else {
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => true), array('type' => 'next', 'name' => ts('Save and New'), 'subName' => 'new'), array('type' => 'cancel', 'name' => ts('Cancel'))));
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:43,代码来源:Campaign.php

示例9: browseCampaign

 function browseCampaign()
 {
     $campaignsData = array();
     //get the campaigns.
     $campaigns = CRM_Campaign_BAO_Campaign::getCampaign(true);
     if (!empty($campaigns)) {
         $campaignType = CRM_Campaign_PseudoConstant::campaignType();
         $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
         $properties = array('id', 'name', 'title', 'status_id', 'description', 'campaign_type_id', 'is_active', 'start_date', 'end_date');
         foreach ($campaigns as $cmpid => $campaign) {
             foreach ($properties as $prop) {
                 $campaignsData[$cmpid][$prop] = CRM_Utils_Array::value($prop, $campaign);
             }
             $statusId = CRM_Utils_Array::value('status_id', $campaign);
             $campaignsData[$cmpid]['status'] = CRM_Utils_Array::value($statusId, $campaignStatus);
             $campaignsData[$cmpid]['campaign_id'] = $campaign['id'];
             $campaignsData[$cmpid]['campaign_type'] = $campaignType[$campaign['campaign_type_id']];
             $action = array_sum(array_keys($this->campaignActionLinks()));
             if ($campaign['is_active']) {
                 $action -= CRM_Core_Action::ENABLE;
             } else {
                 $action -= CRM_Core_Action::DISABLE;
             }
             $campaignsData[$cmpid]['action'] = CRM_Core_Action::formLink(self::campaignActionLinks(), $action, array('id' => $campaign['id']));
         }
     }
     $this->assign('campaigns', $campaignsData);
     $this->assign('addCampaignUrl', CRM_Utils_System::url('civicrm/campaign/add', 'reset=1&action=add'));
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:29,代码来源:DashBoard.php


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