From: Kurund Jalmi Date: Mon, 3 Aug 2015 07:07:08 +0000 (+0530) Subject: Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-08-03-11-26-36 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dbb12634432abb2e58e0f4e4e0f318fa116960f3;p=civicrm-core.git Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-08-03-11-26-36 Conflicts: CRM/Core/BAO/CustomQuery.php CRM/Core/Resources.php sql/civicrm_generated.mysql --- dbb12634432abb2e58e0f4e4e0f318fa116960f3 diff --cc CRM/Contact/Form/Search/Advanced.php index e82ae6bf35,86b127dc02..32742bcc84 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@@ -377,11 -377,7 +377,10 @@@ class CRM_Contact_Form_Search_Advanced '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) { diff --cc CRM/Core/BAO/CustomQuery.php index 66ea074844,37b00ab57c..108e675eee --- a/CRM/Core/BAO/CustomQuery.php +++ b/CRM/Core/BAO/CustomQuery.php @@@ -409,17 -413,11 +413,21 @@@ SELECT label, valu if (!is_array($value)) { $value = CRM_Utils_Type::escape($strtolower($value), 'String'); } + // 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 && strstr($op, 'IN')) { + elseif ($isSerialized) { + if (in_array(key($value), CRM_Core_DAO::acceptedSQLOperators(), TRUE)) { + $op = key($value); + $value = $value[$op]; + } $value = implode(',', $value); } diff --cc CRM/Core/Resources.php index e422547419,e1663fc7bf..44eca40ccd --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@@ -582,17 -587,14 +582,17 @@@ class CRM_Core_Resources // 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); } } @@@ -683,12 -685,14 +683,13 @@@ /** * 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