'activity_type_id',
'status_id',
'activity_subject',
+ 'contribution_page_id',
+ 'contribution_product_id',
+ 'payment_instrument_id',
);
- $specialParams += preg_grep('/^custom_/', array_keys($this->_formValues));
foreach ($specialParams as $element) {
$value = CRM_Utils_Array::value($element, $this->_formValues);
if ($value) {
if (!is_array($value)) {
$value = CRM_Utils_Type::escape($strtolower($value), 'String');
}
- elseif ($isSerialized && strstr($op, 'IN')) {
+ // in api sometimes params is in array('sqlOp' => (mixed)'values') format
+ elseif (!empty($value) && in_array(key($value), CRM_Core_DAO::acceptedSQLOperators(), TRUE) || strstr(key($value), 'EMPTY')) {
+ $op = key($value);
+ $qillOp = CRM_Utils_Array::value($op, CRM_Core_SelectValues::getSearchBuilderOperators(), $op);
+ $value = CRM_Utils_Type::escape($strtolower($value[$op]), 'String');
+ }
+
+ if (strstr($op, 'NULL') || strstr($op, 'EMPTY')) {
+ $qillValue = $value = NULL;
+ }
+ elseif ($isSerialized) {
+ if (in_array(key($value), CRM_Core_DAO::acceptedSQLOperators(), TRUE)) {
+ $op = key($value);
+ $value = $value[$op];
+ }
$value = implode(',', $value);
}
// Add resources from coreResourceList
$jsWeight = -9999;
- foreach ($this->coreResourceList() as $item) {
- foreach ($this->coreResourceList($region) as $file) {
- if (substr($file, -2) == 'js') {
++ foreach ($this->coreResourceList($region) as $item) {
+ if (is_array($item)) {
+ $this->addSetting($item);
+ }
+ elseif (substr($item, -2) == 'js') {
// Don't bother looking for ts() calls in packages, there aren't any
- $translate = (substr($file, 0, 3) == 'js/');
- $this->addScriptFile('civicrm', $file, $jsWeight++, $region, $translate);
+ $translate = (substr($item, 0, 3) == 'js/');
+ $this->addScriptFile('civicrm', $item, $jsWeight++, $region, $translate);
}
else {
- $this->addStyleFile('civicrm', $file, -100, $region);
+ $this->addStyleFile('civicrm', $item, -100, $region);
}
}
/**
* List of core resources we add to every CiviCRM page.
*
+ * Note: non-compressed versions of .min files will be used in debug mode
+ *
+ * @param string $region
* @return array
*/
- public function coreResourceList() {
+ public function coreResourceList($region) {
$config = CRM_Core_Config::singleton();
- // Use minified files for production, uncompressed in debug mode
- // Note, $this->addScriptFile would automatically search for the non-minified file in debug mode but this is probably faster
- $min = $config->debug ? '' : '.min';
// Scripts needed by everyone, everywhere
// FIXME: This is too long; list needs finer-grained segmentation