-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core#3692: use buildOptions for activityType, activityStatus where easy. Also a relationshipType #23880
dev/core#3692: use buildOptions for activityType, activityStatus where easy. Also a relationshipType #23880
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,7 +143,7 @@ public function getDefaultEntity() { | |
public function setFields() { | ||
// Remove print document activity type | ||
$unwanted = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, "AND v.name = 'Print PDF Letter'"); | ||
$activityTypes = array_diff_key(CRM_Core_PseudoConstant::ActivityType(FALSE), $unwanted); | ||
$activityTypes = array_diff_key(CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'search'), $unwanted); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These aren't the same. Before it didn't include case activity types and now it does and also all the ones with filter=1. |
||
|
||
$this->_fields = [ | ||
'subject' => [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ public function preProcess() { | |
CRM_Campaign_BAO_Survey::retrieve($params, $this->_surveyDetails); | ||
|
||
//get the survey activities. | ||
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @demeritcowboy these swaps are safe aren't they? This PR is stale & I think turned out to be way trickier than initial appearance but I'm thinking maybe I can salvage some of the bits that are straight foward There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some of them might be. |
||
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate'); | ||
$statusIds = []; | ||
foreach (['Scheduled'] as $name) { | ||
if ($statusId = array_search($name, $activityStatus)) { | ||
|
@@ -220,7 +220,7 @@ public function postProcess() { | |
//add reservation. | ||
$countVoters = 0; | ||
$maxVoters = $this->_surveyDetails['max_number_of_contacts'] ?? NULL; | ||
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name'); | ||
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate'); | ||
$statusHeld = array_search('Scheduled', $activityStatus); | ||
|
||
$reservedVoterIds = []; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't the same - it now includes disabled. I personally like that but some people won't.