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


PHP CRM_Event_BAO_Event::copy方法代码示例

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


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

示例1: civicrm_api3_event_create

/**
 * Create a Event
 *
 * This API is used for creating a Event
 *
 * @param  array   $params   input parameters
 * Allowed @params array keys are:
 * {@getfields event_create}
 *
 * @return array API result Array.
 * @access public
 */
function civicrm_api3_event_create($params)
{
    civicrm_api3_verify_one_mandatory($params, NULL, array('event_type_id', 'template_id'));
    // Clone event from template
    if (!empty($params['template_id']) && empty($params['id'])) {
        $copy = CRM_Event_BAO_Event::copy($params['template_id']);
        $params['id'] = $copy->id;
        unset($params['template_id']);
    }
    _civicrm_api3_event_create_legacy_support_42($params);
    return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Event');
}
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:24,代码来源:Event.php

示例2: civicrm_api3_event_create

/**
 * Create a Event.
 *
 * @param array $params
 *   Input parameters.
 *
 * @return array
 *   API result Array.
 */
function civicrm_api3_event_create($params)
{
    // Required fields for creating an event
    if (empty($params['id']) && empty($params['is_template'])) {
        civicrm_api3_verify_mandatory($params, NULL, array('start_date', 'title', array('event_type_id', 'template_id')));
    } elseif (empty($params['id']) && !empty($params['is_template'])) {
        civicrm_api3_verify_mandatory($params, NULL, array('template_title'));
    }
    // Clone event from template
    if (!empty($params['template_id']) && empty($params['id'])) {
        $copy = CRM_Event_BAO_Event::copy($params['template_id']);
        $params['id'] = $copy->id;
        unset($params['template_id']);
    }
    _civicrm_api3_event_create_legacy_support_42($params);
    return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Event');
}
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:26,代码来源:Event.php

示例3: civicrm_api3_event_create

/**
 * Create a Event
 *
 * This API is used for creating a Event
 *
 * @param  array   $params   input parameters
 * Allowed @params array keys are:
 * {@getfields event_create}
 *
 * @return array API result Array.
 * @access public
 */
function civicrm_api3_event_create($params)
{
    civicrm_api3_verify_one_mandatory($params, NULL, array('event_type_id', 'template_id'));
    // Clone event from template
    if (!empty($params['template_id']) && empty($params['id'])) {
        $copy = CRM_Event_BAO_Event::copy($params['template_id']);
        $params['id'] = $copy->id;
        unset($params['template_id']);
        if (empty($params['is_template'])) {
            $params['is_template'] = 0;
        }
    }
    _civicrm_api3_event_create_legacy_support_42($params);
    //format custom fields so they can be added
    $values = array();
    _civicrm_api3_custom_format_params($params, $values, 'Event');
    $params = array_merge($values, $params);
    $eventBAO = CRM_Event_BAO_Event::create($params);
    $event = array();
    _civicrm_api3_object_to_array($eventBAO, $event[$eventBAO->id]);
    return civicrm_api3_create_success($event, $params);
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:34,代码来源:Event.php

示例4: postProcess

 /**
  * Process the form submission.
  */
 public function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     //format params
     $params['start_date'] = CRM_Utils_Date::processDate($params['start_date'], $params['start_date_time']);
     $params['end_date'] = CRM_Utils_Date::processDate(CRM_Utils_Array::value('end_date', $params), CRM_Utils_Array::value('end_date_time', $params), TRUE);
     $params['has_waitlist'] = CRM_Utils_Array::value('has_waitlist', $params, FALSE);
     $params['is_map'] = CRM_Utils_Array::value('is_map', $params, FALSE);
     $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
     $params['is_public'] = CRM_Utils_Array::value('is_public', $params, FALSE);
     $params['is_share'] = CRM_Utils_Array::value('is_share', $params, FALSE);
     $params['default_role_id'] = CRM_Utils_Array::value('default_role_id', $params, FALSE);
     $params['id'] = $this->_id;
     $customFields = CRM_Core_BAO_CustomField::getFields('Event', FALSE, FALSE, CRM_Utils_Array::value('event_type_id', $params));
     $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $this->_id, 'Event');
     //merge params with defaults from templates
     if (!empty($params['template_id'])) {
         $params = array_merge(CRM_Event_BAO_Event::getTemplateDefaultValues($params['template_id']), $params);
     }
     $event = CRM_Event_BAO_Event::create($params);
     // now that we have the event’s id, do some more template-based stuff
     if (!empty($params['template_id'])) {
         CRM_Event_BAO_Event::copy($params['template_id'], $event, TRUE);
     }
     $this->set('id', $event->id);
     $this->postProcessHook();
     if ($this->_action & CRM_Core_Action::ADD) {
         $url = 'civicrm/event/manage/location';
         $urlParams = "action=update&reset=1&id={$event->id}";
         // special case for 'Save and Done' consistency.
         if ($this->controller->getButtonName('submit') == '_qf_EventInfo_upload_done') {
             $url = 'civicrm/event/manage';
             $urlParams = 'reset=1';
             CRM_Core_Session::setStatus(ts("'%1' information has been saved.", array(1 => $this->getTitle())), ts('Saved'), 'success');
         }
         CRM_Utils_System::redirect(CRM_Utils_System::url($url, $urlParams));
     }
     parent::endPostProcess();
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:42,代码来源:EventInfo.php

示例5: copy

 /**
  * This function is to make a copy of a Event, including
  * all the fields in the event wizard
  *
  * @return void
  * @access public
  */
 function copy()
 {
     $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, true, 0, 'GET');
     require_once 'CRM/Event/BAO/Event.php';
     $copyEvent = CRM_Event_BAO_Event::copy($id);
     $urlParams = 'reset=1';
     // Redirect to Copied Event Configuration
     if ($copyEvent->id) {
         $urlParams .= '&action=update&id=' . $copyEvent->id;
     }
     return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/manage', $urlParams));
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:19,代码来源:ManageEvent.php

示例6: copy

 /**
  * make a copy of a Event, including
  * all the fields in the event wizard
  *
  * @return void
  */
 public function copy()
 {
     $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE, 0, 'GET');
     $urlString = 'civicrm/event/manage';
     $copyEvent = CRM_Event_BAO_Event::copy($id);
     $urlParams = 'reset=1';
     // Redirect to Copied Event Configuration
     if ($copyEvent->id) {
         $urlString = 'civicrm/event/manage/settings';
         $urlParams .= '&action=update&id=' . $copyEvent->id;
     }
     return CRM_Utils_System::redirect(CRM_Utils_System::url($urlString, $urlParams));
 }
开发者ID:nyimbi,项目名称:civicrm-core,代码行数:19,代码来源:ManageEvent.php

示例7: copy

 /**
  * This function is to make a copy of a Event, including
  * all the fields in the event wizard
  *
  * @return void
  * @access public
  */
 function copy()
 {
     $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, true, 0, 'GET');
     require_once 'CRM/Event/BAO/Event.php';
     CRM_Event_BAO_Event::copy($id);
     return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/manage', 'reset=1'));
 }
开发者ID:bhirsch,项目名称:civicrm,代码行数:14,代码来源:ManageEvent.php


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