From ea100cb57ecd3f37bbc90089a25bbe52a10e4a5f Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 9 Jan 2015 15:00:50 -0800 Subject: [PATCH] INFRA-132 - SpacingAfterBeak --- CRM/Activity/BAO/Query.php | 1 + CRM/Contact/BAO/Contact.php | 2 ++ CRM/Contact/Form/Relationship.php | 3 +++ CRM/Contact/Form/Task/EmailCommon.php | 3 +++ CRM/Contact/Import/Parser/Contact.php | 2 ++ CRM/Contribute/BAO/Contribution.php | 1 + CRM/Contribute/Form/Contribution.php | 2 ++ CRM/Contribute/Import/Parser/Contribution.php | 2 ++ CRM/Core/BAO/RecurringEntity.php | 4 ++++ CRM/Core/ManagedEntities.php | 3 +++ CRM/Event/Import/Field.php | 1 + CRM/Logging/Differ.php | 7 +++++++ CRM/Logging/Reverter.php | 1 + CRM/Mailing/Selector/Event.php | 16 ---------------- CRM/Report/Form.php | 7 ++++--- Civi/CCase/Events.php | 2 ++ Civi/CiUtil/Command/CompareCommand.php | 5 +++++ Civi/Install/Requirements.php | 3 +++ api/v3/Generic.php | 1 + api/v3/Mailing.php | 6 ++++++ api/v3/MailingAB.php | 2 ++ 21 files changed, 55 insertions(+), 19 deletions(-) diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index 48ca703e37..2685b8baf6 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -356,6 +356,7 @@ class CRM_Activity_BAO_Query { ); CRM_Campaign_BAO_Query::componentSearchClause($campParams, $query); break; + case 'activity_result': if (is_array($value)) { $safe = NULL; diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index a4607977eb..ef699fa0c2 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -537,6 +537,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); 'cid' => $this->id, ), ); + case CRM_Core_Action::UPDATE: return array( 'title' => $this->display_name, @@ -3324,6 +3325,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id ) $params['condition'] = "parent_id = (SELECT id FROM civicrm_contact_type WHERE name='{$props['contact_type']}')"; } break; + case 'contact_type': if ($context == 'search') { // CRM-15495 - EntityRef filters and basic search forms expect this format diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 47352ad2cf..a2a937849d 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -145,12 +145,15 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { case CRM_Core_Action::VIEW: CRM_Utils_System::setTitle(ts('View Relationship for %1', array(1 => $this->_display_name_a))); break; + case CRM_Core_Action::ADD: CRM_Utils_System::setTitle(ts('Add Relationship for %1', array(1 => $this->_display_name_a))); break; + case CRM_Core_Action::UPDATE: CRM_Utils_System::setTitle(ts('Edit Relationship for %1', array(1 => $this->_display_name_a))); break; + case CRM_Core_Action::DELETE: CRM_Utils_System::setTitle(ts('Delete Relationship for %1', array(1 => $this->_display_name_a))); break; diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index 14588baa7d..2b8850654c 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -178,9 +178,11 @@ class CRM_Contact_Form_Task_EmailCommon { $form->_contactIds[] = $form->_toContactIds[] = $contactId; $form->_toContactEmails[] = $email; break; + case 'cc': $form->_ccContactIds[] = $contactId; break; + case 'bcc': $form->_bccContactIds[] = $contactId; break; @@ -381,6 +383,7 @@ class CRM_Contact_Form_Task_EmailCommon { $ccValues['email'][] = '"' . $form->_contactDetails[$contactId]['sort_name'] . '" <' . $email . '>'; $ccValues['details'][] = "" . $form->_contactDetails[$contactId]['display_name'] . ""; break; + case 'bcc_id': $bccValues['email'][] = '"' . $form->_contactDetails[$contactId]['sort_name'] . '" <' . $email . '>'; $bccValues['details'][] = "" . $form->_contactDetails[$contactId]['display_name'] . ""; diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 0aff98cc66..5b163576ac 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -1489,6 +1489,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { } } break; + //check for any error in email/postal greeting, addressee, //custom email/postal greeting, custom addressee, CRM-4575 @@ -1976,6 +1977,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { } } break; + case 'CheckBox': case 'AdvMulti-Select': case 'Multi-Select': diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 7e6d19644f..57b00994ac 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3214,6 +3214,7 @@ WHERE contribution_id = %1 "; $params['condition'] = 'id IN (' . implode(',', $types) . ')'; } break; + // CRM-13981 This field was combined with soft_credits in 4.5 but the api still supports it case 'honor_type_id': $className = 'CRM_Contribute_BAO_ContributionSoft'; diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 3043185c89..08d07b3ebc 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -732,10 +732,12 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP unset($status[CRM_Utils_Array::key('Pending', $statusName)]); unset($status[CRM_Utils_Array::key('Failed', $statusName)]); break; + case 'Pending': case 'In Progress': unset($status[CRM_Utils_Array::key('Refunded', $statusName)]); break; + case 'Failed': foreach (array( 'Pending', diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index d72310214e..67e5daf67d 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -279,9 +279,11 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa case 'thankyou_date': $params[$key] = CRM_Utils_Date::formatDate($params[$key], $dateType); break; + case 'pledge_payment': $params[$key] = CRM_Utils_String::strtobool($val); break; + } if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) { if ($customFields[$customFieldID]['data_type'] == 'Date') { diff --git a/CRM/Core/BAO/RecurringEntity.php b/CRM/Core/BAO/RecurringEntity.php index 633656a42d..35913c0511 100644 --- a/CRM/Core/BAO/RecurringEntity.php +++ b/CRM/Core/BAO/RecurringEntity.php @@ -1008,15 +1008,19 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { case 'first': $startActionDate1 = 1; break; + case 'second': $startActionDate1 = 2; break; + case 'third': $startActionDate1 = 3; break; + case 'fourth': $startActionDate1 = 4; break; + case 'last': $startActionDate1 = -1; break; diff --git a/CRM/Core/ManagedEntities.php b/CRM/Core/ManagedEntities.php index 7a093c07ee..36c5a1be15 100644 --- a/CRM/Core/ManagedEntities.php +++ b/CRM/Core/ManagedEntities.php @@ -273,9 +273,11 @@ class CRM_Core_ManagedEntities { case 'always': $doDelete = TRUE; break; + case 'never': $doDelete = FALSE; break; + case 'unused': $getRefCount = civicrm_api3($dao->entity_type, 'getrefcount', array( 'debug' => 1, @@ -289,6 +291,7 @@ class CRM_Core_ManagedEntities { $doDelete = ($total == 0); break; + default: throw new \Exception('Unrecognized cleanup policy: ' . $policy); } diff --git a/CRM/Event/Import/Field.php b/CRM/Event/Import/Field.php index c785340008..655a201fcc 100644 --- a/CRM/Event/Import/Field.php +++ b/CRM/Event/Import/Field.php @@ -113,6 +113,7 @@ class CRM_Event_Import_Field { case 'register_date': return CRM_Utils_Rule::date($this->_value); + /* case 'event_id': static $events = null; diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index 8720a276fa..231895b7cf 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -91,15 +91,19 @@ class CRM_Logging_Differ { case 'civicrm_contact': $contactIdClause = "AND id = %3"; break; + case 'civicrm_note': $contactIdClause = "AND (( entity_id = %3 AND entity_table = 'civicrm_contact' ) OR (entity_id IN (SELECT note.id FROM `{$this->db}`.log_civicrm_note note WHERE note.entity_id = %3 AND note.entity_table = 'civicrm_contact') AND entity_table = 'civicrm_note'))"; break; + case 'civicrm_entity_tag': $contactIdClause = "AND entity_id = %3 AND entity_table = 'civicrm_contact'"; break; + case 'civicrm_relationship': $contactIdClause = "AND (contact_id_a = %3 OR contact_id_b = %3)"; break; + case 'civicrm_activity': $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); @@ -112,9 +116,11 @@ LEFT JOIN civicrm_activity_contact aa ON aa.activity_id = lt.id AND aa.contact_i LEFT JOIN civicrm_activity_contact source ON source.activity_id = lt.id AND source.contact_id = %3 AND source.record_type_id = {$sourceID} "; $contactIdClause = "AND (at.id IS NOT NULL OR aa.id IS NOT NULL OR source.id IS NOT NULL)"; break; + case 'civicrm_case': $contactIdClause = "AND id = (select case_id FROM civicrm_case_contact WHERE contact_id = %3 LIMIT 1)"; break; + default: if (array_key_exists($table, $addressCustomTables)) { $join = "INNER JOIN `{$this->db}`.`log_civicrm_address` et ON et.id = lt.entity_id"; @@ -297,6 +303,7 @@ WHERE lt.log_conn_id = %1 AND case 'civicrm_case': $values[$table]['status_id'] = CRM_Case_PseudoConstant::caseStatus('label', FALSE); break; + case 'civicrm_activity': $values[$table]['status_id'] = CRM_Core_PseudoConstant::activityStatus(); break; diff --git a/CRM/Logging/Reverter.php b/CRM/Logging/Reverter.php index 86a9a4f66b..7fa86e6b16 100644 --- a/CRM/Logging/Reverter.php +++ b/CRM/Logging/Reverter.php @@ -132,6 +132,7 @@ class CRM_Logging_Reverter { $dao->reset(); } break; + // custom data tables case in_array($table, array_keys($ctypes)): diff --git a/CRM/Mailing/Selector/Event.php b/CRM/Mailing/Selector/Event.php index d84e51caa7..be68a41446 100644 --- a/CRM/Mailing/Selector/Event.php +++ b/CRM/Mailing/Selector/Event.php @@ -267,7 +267,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C return $event->getTotalCount($this->_mailing_id, $this->_job_id ); - break; case 'delivered': $event = new CRM_Mailing_Event_BAO_Delivered(); @@ -275,7 +274,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_job_id, $this->_is_distinct ); - break; case 'opened': $event = new CRM_Mailing_Event_BAO_Opened(); @@ -283,7 +281,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_job_id, $this->_is_distinct ); - break; case 'bounce': $event = new CRM_Mailing_Event_BAO_Bounce(); @@ -291,7 +288,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_job_id, $this->_is_distinct ); - break; case 'forward': $event = new CRM_Mailing_Event_BAO_Forward(); @@ -299,7 +295,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_job_id, $this->_is_distinct ); - break; case 'reply': $event = new CRM_Mailing_Event_BAO_Reply(); @@ -307,7 +302,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_job_id, $this->_is_distinct ); - break; case 'unsubscribe': $event = new CRM_Mailing_Event_BAO_Unsubscribe(); @@ -315,7 +309,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_job_id, $this->_is_distinct ); - break; case 'optout': $event = new CRM_Mailing_Event_BAO_Unsubscribe(); @@ -324,7 +317,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_is_distinct, FALSE ); - break; case 'click': $event = new CRM_Mailing_Event_BAO_TrackableURLOpen(); @@ -333,7 +325,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_is_distinct, $this->_url_id ); - break; default: return 0; @@ -370,21 +361,18 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_job_id, $this->_is_distinct, $offset, $rowCount, $sort ); - break; case 'opened': return CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id, $this->_job_id, $this->_is_distinct, $offset, $rowCount, $sort ); - break; case 'bounce': return CRM_Mailing_Event_BAO_Bounce::getRows($this->_mailing_id, $this->_job_id, $this->_is_distinct, $offset, $rowCount, $sort ); - break; case 'forward': return CRM_Mailing_Event_BAO_Forward::getRows($this->_mailing_id, @@ -397,21 +385,18 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_job_id, $this->_is_distinct, $offset, $rowCount, $sort ); - break; case 'unsubscribe': return CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id, $this->_job_id, $this->_is_distinct, $offset, $rowCount, $sort, TRUE ); - break; case 'optout': return CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id, $this->_job_id, $this->_is_distinct, $offset, $rowCount, $sort, FALSE ); - break; case 'click': return CRM_Mailing_Event_BAO_TrackableURLOpen::getRows( @@ -419,7 +404,6 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C $this->_is_distinct, $this->_url_id, $offset, $rowCount, $sort ); - break; default: return NULL; diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 93fd14fdd3..4109507392 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -592,12 +592,15 @@ class CRM_Report_Form extends CRM_Core_Form { case CRM_Utils_Type::T_FLOAT: $this->_columns[$tableName][$fieldGrp][$fieldName]['operatorType'] = CRM_Report_Form::OP_FLOAT; break; + case CRM_Utils_Type::T_INT: $this->_columns[$tableName][$fieldGrp][$fieldName]['operatorType'] = CRM_Report_Form::OP_INT; break; + case CRM_Utils_Type::T_DATE: $this->_columns[$tableName][$fieldGrp][$fieldName]['operatorType'] = CRM_Report_Form::OP_DATE; break; + case CRM_Utils_Type::T_BOOLEAN: $this->_columns[$tableName][$fieldGrp][$fieldName]['operatorType'] = CRM_Report_Form::OP_SELECT; if (!array_key_exists('options', $this->_columns[$tableName][$fieldGrp][$fieldName])) { @@ -609,6 +612,7 @@ class CRM_Report_Form extends CRM_Core_Form { ); } break; + default: if ($daoOrBaoName && array_key_exists('pseudoconstant', $this->_columns[$tableName][$fieldGrp][$fieldName]) @@ -1276,7 +1280,6 @@ class CRM_Report_Form extends CRM_Core_Form { 'nll' => ts('Is empty (Null)'), 'nnll' => ts('Is not empty (Null)'), ); - break; case CRM_Report_Form::OP_SELECT: return array( @@ -1290,14 +1293,12 @@ class CRM_Report_Form extends CRM_Core_Form { 'in' => ts('Is one of'), 'notin' => ts('Is not one of'), ); - break; case CRM_Report_Form::OP_DATE: return array( 'nll' => ts('Is empty (Null)'), 'nnll' => ts('Is not empty (Null)'), ); - break; case CRM_Report_Form::OP_MULTISELECT_SEPARATOR: // use this operator for the values, concatenated with separator. For e.g if diff --git a/Civi/CCase/Events.php b/Civi/CCase/Events.php index 0d4cecd41b..13a42efe33 100644 --- a/Civi/CCase/Events.php +++ b/Civi/CCase/Events.php @@ -48,6 +48,7 @@ class Events { $caseId = $event->object->case_id; } break; + case 'Case': // by the time we get the post-delete event, the record is gone, so // there's nothing to analyze @@ -55,6 +56,7 @@ class Events { $caseId = $event->id; } break; + default: throw new \CRM_Core_Exception("CRM_Case_Listener does not support entity {$event->entity}"); } diff --git a/Civi/CiUtil/Command/CompareCommand.php b/Civi/CiUtil/Command/CompareCommand.php index 7e603a7a9b..262ee617f8 100644 --- a/Civi/CiUtil/Command/CompareCommand.php +++ b/Civi/CiUtil/Command/CompareCommand.php @@ -17,18 +17,23 @@ class CompareCommand { case '--phpunit-json': $parser = array('\Civi\CiUtil\PHPUnitParser', 'parseJsonResults'); break; + case '--jenkins-xml': $parser = array('\Civi\CiUtil\JenkinsParser', 'parseXmlResults'); break; + case '--csv': $parser = array('\Civi\CiUtil\CSVParser', 'parseResults'); break; + case '--out=txt': $printerType = 'txt'; break; + case '--out=csv': $printerType = 'csv'; break; + default: $suites[] = array( 'file' => $argv[$i], diff --git a/Civi/Install/Requirements.php b/Civi/Install/Requirements.php index 14d023e6da..8d4a6af612 100644 --- a/Civi/Install/Requirements.php +++ b/Civi/Install/Requirements.php @@ -142,10 +142,13 @@ class Requirements { switch (strtolower(substr($memString, -1))) { case "k": return round(substr($memString, 0, -1) * 1024); + case "m": return round(substr($memString, 0, -1) * 1024 * 1024); + case "g": return round(substr($memString, 0, -1) * 1024 * 1024 * 1024); + default: return round($memString); } diff --git a/api/v3/Generic.php b/api/v3/Generic.php index 99e6274bd5..7f2ed076bb 100644 --- a/api/v3/Generic.php +++ b/api/v3/Generic.php @@ -56,6 +56,7 @@ function civicrm_api3_generic_getfields($apiRequest) { case 'getfields': $values = _civicrm_api_get_fields($entity, FALSE, $apiRequest['params']); return civicrm_api3_create_success($values, $apiRequest['params'], $entity, 'getfields'); + case 'create': case 'update': case 'replace': diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index 3135ac2e09..bc27bf1d91 100755 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -79,11 +79,13 @@ function civicrm_api3_mailing_get_token($params) { case 'Mailing': $tokens = array_merge(CRM_Core_SelectValues::mailingTokens(), $tokens); break; + case 'ScheduleEventReminder': $tokens = array_merge(CRM_Core_SelectValues::activityTokens(), $tokens); $tokens = array_merge(CRM_Core_SelectValues::eventTokens(), $tokens); $tokens = array_merge(CRM_Core_SelectValues::membershipTokens(), $tokens); break; + case 'ManageEventScheduleReminder': $tokens = array_merge(CRM_Core_SelectValues::eventTokens(), $tokens); break; @@ -553,21 +555,25 @@ function civicrm_api3_mailing_stats($params) { $detail => CRM_Mailing_Event_BAO_Delivered::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']), ); break; + case 'Bounces': $stats[$params['mailing_id']] += array( $detail => CRM_Mailing_Event_BAO_Bounce::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']), ); break; + case 'Unsubscribers': $stats[$params['mailing_id']] += array( $detail => CRM_Mailing_Event_BAO_Unsubscribe::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']), ); break; + case 'Unique Clicks': $stats[$params['mailing_id']] += array( $detail => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']), ); break; + case 'Opened': $stats[$params['mailing_id']] += array( $detail => CRM_Mailing_Event_BAO_Opened::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']), diff --git a/api/v3/MailingAB.php b/api/v3/MailingAB.php index 71ae22bb3d..fbbe48d492 100755 --- a/api/v3/MailingAB.php +++ b/api/v3/MailingAB.php @@ -229,6 +229,7 @@ function civicrm_api3_mailing_a_b_graph_stats($params) { ), ); break; + case 'total unique clicks': $result = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows($mailingAB['mailing_id_a'], NULL, TRUE, 0, 1, "civicrm_mailing_event_trackable_url_open.time_stamp ASC"); $startDate = CRM_Utils_Date::processDate($result[0]['date']); @@ -243,6 +244,7 @@ function civicrm_api3_mailing_a_b_graph_stats($params) { ), ); break; + case 'total clicks on a particular link': if (empty($params['target_url'])) { throw new API_Exception("Provide url to get stats result for total clicks on a particular link"); -- 2.25.1