Skip to content

Commit

Permalink
CiviCRM no longer tabe $_tableName property (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcclelland authored Aug 27, 2024
1 parent 88d4756 commit 3e95676
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CRM/Volunteer/Angular/Tab/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protected static function initializeProject($eventId) {
$project = new CRM_Volunteer_BAO_Project();
$project->id = 0;
$project->entity_id = $eventId;
$project->entity_table = CRM_Event_DAO_Event::$_tableName;
$project->entity_table = CRM_Event_DAO_Event::getTableName();

return $project;
}
Expand All @@ -33,7 +33,7 @@ public static function prepareTab($eventId) {

$project = current(CRM_Volunteer_BAO_Project::retrieve(array(
'entity_id' => $eventId,
'entity_table' => CRM_Event_DAO_Event::$_tableName,
'entity_table' => CRM_Event_DAO_Event::getTableName(),
)));
if (!$project) {
$project = self::initializeProject($eventId);
Expand Down
6 changes: 3 additions & 3 deletions CRM/Volunteer/BAO/Assignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ public static function retrieve(array $params) {
if (CRM_Utils_Array::value($key, $activity_fields)) {
$dataType = CRM_Utils_Type::typeToString($activity_fields[$key]['type']);
$fieldName = $activity_fields[$key]['name'];
$tableName = CRM_Activity_DAO_Activity::$_tableName;
$tableName = CRM_Activity_DAO_Activity::getTableName();
} elseif (CRM_Utils_Array::value($key, $contact_fields)) {
$dataType = CRM_Utils_Type::typeToString($contact_fields[$key]['type']);
$fieldName = $contact_fields[$key]['name'];
$tableName = CRM_Contact_DAO_Contact::$_tableName;
$tableName = CRM_Contact_DAO_Contact::getTableName();
} elseif (CRM_Utils_Array::value($key, $custom_fields)) {
$dataType = $custom_fields[$key]['data_type'];
$fieldName = $custom_fields[$key]['column_name'];
$tableName = $customTableName;
} elseif($key == 'project_id') {
$dataType = 'Int';
$fieldName = 'id';
$tableName = CRM_Volunteer_DAO_Project::$_tableName;
$tableName = CRM_Volunteer_DAO_Project::getTableName();
} elseif ($key == 'target_contact_id') {
$dataType = 'Int';
$fieldName = 'contact_id';
Expand Down
6 changes: 3 additions & 3 deletions CRM/Volunteer/BAO/Commendation.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ public static function retrieve(array $params) {
if (CRM_Utils_Array::value($key, $activity_fields)) {
$dataType = CRM_Utils_Type::typeToString($activity_fields[$key]['type']);
$fieldName = $activity_fields[$key]['name'];
$tableName = CRM_Activity_DAO_Activity::$_tableName;
$tableName = CRM_Activity_DAO_Activity::getTableName();
} elseif (CRM_Utils_Array::value($key, $contact_fields)) {
$dataType = CRM_Utils_Type::typeToString($contact_fields[$key]['type']);
$fieldName = $contact_fields[$key]['name'];
$tableName = CRM_Contact_DAO_Contact::$_tableName;
$tableName = CRM_Contact_DAO_Contact::getTableName();
} elseif (CRM_Utils_Array::value($key, $custom_fields)) {
$dataType = $custom_fields[$key]['data_type'];
$fieldName = $custom_fields[$key]['column_name'];
Expand Down Expand Up @@ -183,4 +183,4 @@ public static function retrieve(array $params) {

return $rows;
}
}
}
4 changes: 2 additions & 2 deletions volunteer.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function volunteer_civicrm_tabset($tabsetName, &$tabs, $context) {
'current' => false,
);

if (!CRM_Volunteer_BAO_Project::isActive($eventId, CRM_Event_DAO_Event::$_tableName)) {
if (!CRM_Volunteer_BAO_Project::isActive($eventId, CRM_Event_DAO_Event::getTableName())) {
$tab['volunteer']['valid'] = FALSE;
}
}
Expand All @@ -175,7 +175,7 @@ function volunteer_civicrm_tabset($tabsetName, &$tabs, $context) {

// on manage events listing screen, this section sets volunteer tab in configuration popup as enabled/disabled.
if ($tabsetName == 'civicrm/event/manage/rows' && $eventId) {
$tabs[$eventId]['is_volunteer'] = CRM_Volunteer_BAO_Project::isActive($eventId, CRM_Event_DAO_Event::$_tableName);
$tabs[$eventId]['is_volunteer'] = CRM_Volunteer_BAO_Project::isActive($eventId, CRM_Event_DAO_Event::getTableName());
}
}

Expand Down

0 comments on commit 3e95676

Please sign in to comment.