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


PHP CRM_Core_DAO::getAttribute方法代码示例

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


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

示例1: buildQuickForm

 /**
  * Function to actually build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     $this->addElement('text', 'api_key', ts('API Key'), array('size' => 48));
     $status = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
     foreach ($status as $id => $Name) {
         $this->addElement('checkbox', "participant_status_id[{$id}]", NULL, $Name);
     }
     $accessToken = CRM_Core_BAO_Setting::getItem(self::WEBINAR_SETTING_GROUP, 'access_token', NULL, FALSE);
     $organizerKey = CRM_Core_BAO_Setting::getItem(self::WEBINAR_SETTING_GROUP, 'organizer_key', NULL, FALSE);
     if ($accessToken && $organizerKey) {
         $upcomingWebinars = CRM_Gotowebinar_Form_Setting::findUpcomingWebinars();
         if (isset($upcomingWebinars['int_err_code']) and $upcomingWebinars['int_err_code'] != '') {
             $this->assign('error', $upcomingWebinars);
         } else {
             $this->assign('responseKey', TRUE);
             $this->assign('upcomingWebinars', $upcomingWebinars);
             $buttons = array(array('type' => 'submit', 'name' => ts('Save Status')));
             $this->addButtons($buttons);
         }
     } else {
         $this->add('text', "email_address", ts('Email Address'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', 'email'), TRUE);
         $this->add('text', "password", ts('Password'), array('size' => 48), TRUE);
         $buttons = array(array('type' => 'submit', 'name' => ts('Connect To My GoToWebinar')));
         // Add the Buttons.
         $this->addButtons($buttons);
         $this->assign('initial', TRUE);
     }
 }
开发者ID:krishgopi,项目名称:uk.co.vedaconsulting.gotowebinar,代码行数:34,代码来源:Setting.php

示例2: buildQuickForm

 /**
  * Build the form object.
  *
  *
  * @return void
  */
 public function buildQuickForm()
 {
     if ($this->_search) {
         return;
     }
     $attributes = CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Survey');
     $this->add('text', 'petition_title', ts('Title'), $attributes['title']);
     //campaigns
     $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
     $this->add('select', 'petition_campaign_id', ts('Campaign'), array('' => ts('- select -')) + $campaigns);
     $this->set('petitionCampaigns', $campaigns);
     $this->assign('petitionCampaigns', json_encode($campaigns));
     //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:BorislavZlatanov,项目名称:civicrm-core,代码行数:31,代码来源:Petition.php

示例3: buildQuickForm

 /**
  * Build the form - it consists of
  *    - displaying the QILL (query in local language)
  *    - displaying elements for saving the search
  *
  * @access public
  * @return void
  */
 function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Smart Group'));
     require_once "CRM/Event/BAO/Query.php";
     // get the qill
     $query =& new CRM_Event_BAO_Query($this->get('formValues'));
     $qill = $query->qill();
     // need to save qill for the smarty template
     $this->assign('qill', $qill);
     // the name and description are actually stored with the group and not the saved search
     $this->add('text', 'title', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'title'), true);
     $this->addElement('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'description'));
     // get the group id for the saved search
     $groupId = null;
     if (isset($this->_id)) {
         $params = array('saved_search_id' => $this->_id);
         require_once "CRM/Contact/BAO/Group.php";
         CRM_Contact_BAO_Group::retrieve($params, $values);
         $groupId = $values['id'];
         $this->addDefaultButtons(ts('Update Smart Group'));
     } else {
         $this->addDefaultButtons(ts('Save Smart Group'));
     }
     $this->addRule('title', ts('Name already exists in Database.'), 'objectExists', array('CRM_Contact_DAO_Group', $groupId, 'title'));
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:33,代码来源:SaveSearch.php

示例4: buildQuickForm

 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     if ($this->_id) {
         $name = $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipStatus', 'name'));
         $name->freeze();
         $this->assign('id', $this->_id);
     }
     $this->add('text', 'label', ts('Label'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipStatus', 'label'), TRUE);
     $this->addRule('label', ts('A membership status with this label already exists. Please select another label.'), 'objectExists', array('CRM_Member_DAO_MembershipStatus', $this->_id, 'name'));
     $this->add('select', 'start_event', ts('Start Event'), CRM_Core_SelectValues::eventDate(), TRUE);
     $this->add('select', 'start_event_adjust_unit', ts('Start Event Adjustment'), array('' => ts('- select -')) + CRM_Core_SelectValues::unitList());
     $this->add('text', 'start_event_adjust_interval', ts('Start Event Adjust Interval'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipStatus', 'start_event_adjust_interval'));
     $this->add('select', 'end_event', ts('End Event'), array('' => ts('- select -')) + CRM_Core_SelectValues::eventDate());
     $this->add('select', 'end_event_adjust_unit', ts('End Event Adjustment'), array('' => ts('- select -')) + CRM_Core_SelectValues::unitList());
     $this->add('text', 'end_event_adjust_interval', ts('End Event Adjust Interval'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipStatus', 'end_event_adjust_interval'));
     $this->add('checkbox', 'is_current_member', ts('Current Membership?'));
     $this->add('checkbox', 'is_admin', ts('Administrator Only?'));
     $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipStatus', 'weight'));
     $this->add('checkbox', 'is_default', ts('Default?'));
     $this->add('checkbox', 'is_active', ts('Enabled?'));
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:31,代码来源:MembershipStatus.php

示例5: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     $this->add('text', 'label_a_b', ts('Relationship Label-A to B'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_RelationshipType', 'label_a_b'), true);
     $this->addRule('label_a_b', ts('Label already exists in Database.'), 'objectExists', array('CRM_Contact_DAO_RelationshipType', $this->_id, 'label_a_b'));
     $this->add('text', 'label_b_a', ts('Relationship Label-B to A'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_RelationshipType', 'label_b_a'));
     $this->addRule('label_b_a', ts('Label already exists in Database.'), 'objectExists', array('CRM_Contact_DAO_RelationshipType', $this->_id, 'label_b_a'));
     $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_RelationshipType', 'description'));
     require_once 'CRM/Contact/BAO/ContactType.php';
     $contactTypes = CRM_Contact_BAO_ContactType::getSelectElements();
     // add select for contact type
     $contactTypeA =& $this->add('select', 'contact_types_a', ts('Contact Type A') . ' ', array('' => ts('- select -')) + $contactTypes);
     $contactTypeB =& $this->add('select', 'contact_types_b', ts('Contact Type B') . ' ', array('' => ts('- select -')) + $contactTypes);
     $isActive =& $this->add('checkbox', 'is_active', ts('Enabled?'));
     //only selected field should be allow for edit, CRM-4888
     if ($this->_id && CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', $this->_id, 'is_reserved')) {
         foreach (array('contactTypeA', 'contactTypeB', 'isActive') as $field) {
             ${$field}->freeze();
         }
     }
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->freeze();
         $url = CRM_Utils_System::url('civicrm/admin/reltype&reset=1');
         $location = "window.location='{$url}'";
         $this->addElement('button', 'done', ts('Done'), array('onclick' => $location));
     }
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:37,代码来源:RelationshipType.php

示例6: buildQuickForm

 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     $this->setPageTitle(ts('Mail Account'));
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     //get the attributes.
     $attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_MailSettings');
     //build setting form
     $this->add('text', 'name', ts('Name'), $attributes['name'], TRUE);
     $this->add('text', 'domain', ts('Email Domain'), $attributes['domain'], TRUE);
     $this->addRule('domain', ts('Email domain must use a valid internet domain format (e.g. \'example.org\').'), 'domain');
     $this->add('text', 'localpart', ts('Localpart'), $attributes['localpart']);
     $this->add('text', 'return_path', ts('Return-Path'), $attributes['return_path']);
     $this->addRule('return_path', ts('Return-Path must use a valid email address format.'), 'email');
     $this->add('select', 'protocol', ts('Protocol'), array('' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_MailSettings', 'protocol'), TRUE);
     $this->add('text', 'server', ts('Server'), $attributes['server']);
     $this->add('text', 'username', ts('Username'), array('autocomplete' => 'off'));
     $this->add('password', 'password', ts('Password'), array('autocomplete' => 'off'));
     $this->add('text', 'source', ts('Source'), $attributes['source']);
     $this->add('checkbox', 'is_ssl', ts('Use SSL?'));
     $usedfor = array(1 => ts('Bounce Processing'), 0 => ts('Email-to-Activity Processing'));
     $this->add('select', 'is_default', ts('Used For?'), $usedfor);
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:29,代码来源:MailSettings.php

示例7: buildQuickForm

 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     $this->setPageTitle(ts('Location Type'));
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_LocationType', 'name'), TRUE);
     $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_LocationType', $this->_id));
     $this->addRule('name', ts('Name can only consist of alpha-numeric characters'), 'variable');
     $this->add('text', 'display_name', ts('Display Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_LocationType', 'display_name'), TRUE);
     $this->add('text', 'vcard_name', ts('vCard Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_LocationType', 'vcard_name'));
     $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_LocationType', 'description'));
     $this->add('checkbox', 'is_active', ts('Enabled?'));
     $this->add('checkbox', 'is_default', ts('Default?'));
     if ($this->_action & CRM_Core_Action::UPDATE) {
         if (CRM_Core_DAO::getFieldValue('CRM_Core_DAO_LocationType', $this->_id, 'is_reserved')) {
             $this->freeze(array('name', 'description', 'is_active'));
         }
         if (CRM_Core_DAO::getFieldValue('CRM_Core_DAO_LocationType', $this->_id, 'is_default')) {
             $this->freeze(array('is_default'));
         }
     }
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:28,代码来源:LocationType.php

示例8: buildQuickForm

 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     if ($this->_id) {
         $this->_title = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $this->_id, 'name');
         CRM_Utils_System::setTitle($this->_title . ' - ' . ts('Financial Type'));
     }
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Financial_DAO_FinancialType', 'name'), TRUE);
     $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Financial_DAO_FinancialType', 'description'));
     $this->add('checkbox', 'is_deductible', ts('Tax-Deductible?'), CRM_Core_DAO::getAttribute('CRM_Financial_DAO_FinancialType', 'is_deductible'));
     $this->add('checkbox', 'is_active', ts('Enabled?'), CRM_Core_DAO::getAttribute('CRM_Financial_DAO_FinancialType', 'is_active'));
     $this->add('checkbox', 'is_reserved', ts('Reserved?'), CRM_Core_DAO::getAttribute('CRM_Financial_DAO_FinancialType', 'is_reserved'));
     if ($this->_action == CRM_Core_Action::UPDATE) {
         $this->assign('aid', $this->_id);
     }
     if ($this->_action == CRM_Core_Action::UPDATE && CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $this->_id, 'is_reserved', 'vid')) {
         $this->freeze(array('is_active'));
     }
     //$this->addFormRule( array( 'CRM_Financial_Form_FinancialType', 'formRule'), $this );
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:31,代码来源:FinancialType.php

示例9: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     if (isset($this->_id)) {
         $params = array('id' => $this->_id);
         CRM_Core_BAO_Navigation::retrieve($params, $this->_defaults);
     }
     $this->applyFilter('__ALL__', 'trim');
     $this->add('text', 'label', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Navigation', 'label'), true);
     $this->add('text', 'url', ts('Url'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Navigation', 'url'));
     require_once 'CRM/Core/Permission.php';
     $permissions = CRM_Core_Permission::basicPermissions(true);
     $include =& $this->addElement('advmultiselect', 'permission', ts('Permission') . ' ', $permissions, array('size' => 5, 'style' => 'width:150px', 'class' => 'advmultiselect'));
     $include->setButtonAttributes('add', array('value' => ts('Add >>')));
     $include->setButtonAttributes('remove', array('value' => ts('<< Remove')));
     $operators = array('AND' => 'AND', 'OR' => 'OR');
     $this->add('select', 'permission_operator', ts('Operator'), $operators);
     $this->add('checkbox', 'has_separator', ts('Separator?'));
     $active = $this->add('checkbox', 'is_active', ts('Enabled?'));
     if ($this->_defaults['name'] == 'Home') {
         $active->freeze();
     } else {
         $parentMenu = CRM_Core_BAO_Navigation::getNavigationList();
         if (isset($this->_id)) {
             unset($parentMenu[$this->_id]);
         }
         // also unset home.
         $homeMenuId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Home', 'id', 'name');
         unset($parentMenu[$homeMenuId]);
         $parent = $this->add('select', 'parent_id', ts('Parent'), array('' => ts('-- select --')) + $parentMenu);
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:41,代码来源:Navigation.php

示例10: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     //get the attributes.
     $attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_MailSettings');
     //build setting form
     $this->add('text', 'name', ts('Name'), $attributes['name'], true);
     $this->add('text', 'domain', ts('Email Domain'), $attributes['domain'], true);
     $this->addRule('domain', ts('Email domain must use a valid internet domain format (e.g. \'example.org\').'), 'domain');
     $this->add('text', 'localpart', ts('Localpart'), $attributes['localpart']);
     $this->add('text', 'return_path', ts('Return-Path'), $attributes['return_path']);
     $this->addRule('return_path', ts('Return-Path must use a valid email address format.'), 'email');
     require_once 'CRM/Core/PseudoConstant.php';
     $this->add('select', 'protocol', ts('Protocol'), array('' => ts('- select -')) + CRM_Core_PseudoConstant::mailProtocol(), true);
     $this->add('text', 'server', ts('Server'), $attributes['server']);
     $this->add('text', 'username', ts('Username'), array('autocomplete' => 'off'));
     $this->add('password', 'password', ts('Password'), array('autocomplete' => 'off'));
     $this->add('text', 'source', ts('Source'), $attributes['source']);
     $this->add('checkbox', 'is_ssl', ts('Use SSL?'));
     $this->add('checkbox', 'is_default', ts('Default Option?'));
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:31,代码来源:MailSettings.php

示例11: buildQuickForm

 /**
  * Build the form object.
  *
  * It consists of
  *    - displaying the QILL (query in local language)
  *    - displaying elements for saving the search
  */
 public function buildQuickForm()
 {
     // @todo sync this more with CRM_Group_Form_Edit.
     $query = new CRM_Contact_BAO_Query($this->get('queryParams'));
     $this->assign('qill', $query->qill());
     // Values from the search form
     $formValues = $this->controller->exportValues();
     // the name and description are actually stored with the group and not the saved search
     $this->add('text', 'title', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'title'), TRUE);
     $this->addElement('textarea', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'description'));
     $groupTypes = CRM_Core_OptionGroup::values('group_type', TRUE);
     unset($groupTypes['Access Control']);
     if (!CRM_Core_Permission::access('CiviMail')) {
         $isWorkFlowEnabled = CRM_Mailing_Info::workflowEnabled();
         if ($isWorkFlowEnabled && !CRM_Core_Permission::check('create mailings') && !CRM_Core_Permission::check('schedule mailings') && !CRM_Core_Permission::check('approve mailings')) {
             unset($groupTypes['Mailing List']);
         }
     }
     if (!empty($groupTypes)) {
         $this->addCheckBox('group_type', ts('Group Type'), $groupTypes, NULL, NULL, NULL, NULL, '&nbsp;&nbsp;&nbsp;');
     }
     //CRM-14190
     CRM_Group_Form_Edit::buildParentGroups($this);
     // get the group id for the saved search
     $groupID = NULL;
     if (isset($this->_id)) {
         $groupID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_id, 'id', 'saved_search_id');
         $this->addDefaultButtons(ts('Update Smart Group'));
     } else {
         $this->addDefaultButtons(ts('Save Smart Group'));
         $this->assign('partiallySelected', $formValues['radio_ts'] != 'ts_all');
     }
     $this->addRule('title', ts('Name already exists in Database.'), 'objectExists', array('CRM_Contact_DAO_Group', $groupID, 'title'));
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:41,代码来源:SaveSearch.php

示例12: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionGroup', 'name'), true);
     $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_OptionGroup', $this->_id));
     $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionGroup', 'description'));
     $element = $this->add('checkbox', 'is_active', ts('Enabled?'));
     if ($this->_action & CRM_Core_Action::UPDATE) {
         if (in_array($this->_values['name'], array('encounter_medium', 'case_type', 'case_status'))) {
             static $caseCount = null;
             require_once 'CRM/Case/BAO/Case.php';
             if (!isset($caseCount)) {
                 $caseCount = CRM_Case_BAO_Case::caseCount(null, false);
             }
             if ($caseCount > 0) {
                 $element->freeze();
             }
         }
         if ($this->_values['is_reserved']) {
             $this->freeze(array('name', 'description', 'is_active'));
         }
     }
     $this->assign('id', $this->_id);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:34,代码来源:OptionGroup.php

示例13: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     if ($this->_action == CRM_Core_Action::DELETE) {
         if ($this->_id && ($tag = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Tag', $this->_id, 'name', 'parent_id'))) {
             CRM_Core_Session::setStatus(ts("This tag cannot be deleted! You must Delete all its child tags ('%1', etc) prior to deleting this tag.", array(1 => $tag)));
             $url = CRM_Utils_System::url('civicrm/admin/tag', "reset=1");
             CRM_Utils_System::redirect($url);
             return true;
         } else {
             $this->addButtons(array(array('type' => 'next', 'name' => ts('Delete'), 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
         }
     } else {
         $this->applyFilter('__ALL__', 'trim');
         $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'name'), true);
         $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_Tag', $this->_id));
         $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'description'));
         //@lobo haven't a clue why the checkbox isn't displayed (it should be checked by default
         $this->add('checkbox', 'is_selectable', ts("If it's a tag or a category"));
         $allTag = array('' => '- ' . ts('select') . ' -') + CRM_Core_PseudoConstant::tag();
         if ($this->_id) {
             unset($allTag[$this->_id]);
         }
         $this->add('select', 'parent_id', ts('Parent Tag'), $allTag);
         parent::buildQuickForm();
     }
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:32,代码来源:Tag.php

示例14: buildQuickForm

 /**
  * Function to actually build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     $this->addElement('checkbox', 'premiums_active', ts('Premiums Section Enabled?'), NULL, array('onclick' => "premiumBlock(this);"));
     $this->addElement('text', 'premiums_intro_title', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Premium', 'premiums_intro_title'));
     $this->add('textarea', 'premiums_intro_text', ts('Introductory Message'), 'rows=5, cols=50');
     $this->add('text', 'premiums_contact_email', ts('Contact Email') . ' ', CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Premium', 'premiums_contact_email'));
     $this->addRule('premiums_contact_email', ts('Please enter a valid email address for Contact Email') . ' ', 'email');
     $this->add('text', 'premiums_contact_phone', ts('Contact Phone'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Premium', 'premiums_contact_phone'));
     $this->addRule('premiums_contact_phone', ts('Please enter a valid phone number.'), 'phone');
     $this->addElement('checkbox', 'premiums_display_min_contribution', ts('Display Minimum Contribution Amount?'));
     $showForm = TRUE;
     if ($this->_single) {
         if ($this->_id) {
             $daoPremium = new CRM_Contribute_DAO_Premium();
             $daoPremium->entity_id = $this->_id;
             $daoPremium->entity_table = 'civicrm_contribution_page';
             $daoPremium->premiums_active = 1;
             if ($daoPremium->find(TRUE)) {
                 $showForm = FALSE;
             }
         }
     }
     $this->assign('showForm', $showForm);
     parent::buildQuickForm();
     $premiumPage = new CRM_Contribute_Page_Premium();
     $premiumPage->browse();
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:33,代码来源:Premium.php

示例15: buildQuickForm

 public function buildQuickForm()
 {
     $parent = $this->controller->getParent();
     $nameTextLabel = $parent->_sms ? ts('SMS Name') : ts('Mailing Name');
     $this->add('text', 'mailing_name', $nameTextLabel, CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Mailing', 'title'));
     CRM_Core_Form_Date::buildDateRange($this, 'mailing', 1, '_from', '_to', ts('From'), FALSE);
     $this->add('text', 'sort_name', ts('Created or Sent by'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
     CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($this);
     // CRM-15434 - Fix mailing search by status in non-English languages
     $statusVals = CRM_Core_SelectValues::getMailingJobStatus();
     foreach ($statusVals as $statusId => $statusName) {
         $this->addElement('checkbox', "mailing_status[{$statusId}]", NULL, $statusName);
     }
     $this->addElement('checkbox', 'status_unscheduled', NULL, ts('Draft / Unscheduled'));
     $this->addYesNo('is_archived', ts('Mailing is Archived'), TRUE);
     // Search by language, if multi-lingual
     $enabledLanguages = CRM_Core_I18n::languages(TRUE);
     if (count($enabledLanguages) > 1) {
         $this->addElement('select', 'language', ts('Language'), array('' => ts('- all languages -')) + $enabledLanguages, array('class' => 'crm-select2'));
     }
     if ($parent->_sms) {
         $this->addElement('hidden', 'sms', $parent->_sms);
     }
     $this->add('hidden', 'hidden_find_mailings', 1);
     $this->addButtons(array(array('type' => 'refresh', 'name' => ts('Search'), 'isDefault' => TRUE)));
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:26,代码来源:Search.php


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