+
+ /**
+ * Get options for a given field.
+ * @see CRM_Core_DAO::buildOptions
+ *
+ * @param String $fieldName
+ * @param String $context : @see CRM_Core_DAO::buildOptionsContext
+ * @param Array $props : whatever is known about this dao object
+ *
+ * @return Array|bool
+ */
+ public static function buildOptions($fieldName, $context = NULL, $props = array()) {
+ $params = array('condition' => array());
+
+ if ($fieldName == 'status_id' && $context != 'validate') {
+ // Get rid of cart-related option if disabled
+ // FIXME: Why does this option even exist if cart is disabled?
+ if (!CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME, 'enable_cart')) {
+ $params['condition'][] = "name <> 'Pending in cart'";
+ }
+ }
+
+ return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
+ }