<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
public $_action;
/**
- * This function sets the default values for the form. For edit/view mode
+ * Set default values for the form. For edit/view mode
* the default values are retrieved from the database
*
* @access public
CRM_Event_BAO_Event::retrieve($params, $defaults);
- if (isset($defaults['parent_event_id'])) {
- $params = array('id' => $defaults['parent_event_id']);
- $r_defaults = array();
- $parent_event = CRM_Event_BAO_Event::retrieve($params, $r_defaults);
- $defaults['parent_event_name'] = $parent_event->title;
- }
-
$defaults = array_merge($defaults, $parentDefaults);
$defaults['id'] = $eventId;
}
/**
- * Function to build the form
+ * Build the form object
*
* @return void
* @access public
FALSE
);
- $this->addElement('text', 'parent_event_name', ts('Parent Event'));
- $this->addElement('hidden', 'parent_event_id');
+ $this->addEntityRef('parent_event_id', ts('Parent Event'), array(
+ 'entity' => 'event',
+ 'placeholder' => ts('- any -'),
+ 'select' => array('minimumInputLength' => 0),
+ )
+ );
parent::buildQuickForm();
}