Skip to content

Commit

Permalink
Cambiar lógica de load_activities a get_activities
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuSinergiaCRM committed Oct 7, 2024
1 parent 2a93d63 commit 6ae1c4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 4 additions & 7 deletions custom/modules/Calendar/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,15 @@ public function load_activities()
$item['color'] = $act->sugar_bean->color ? '#'.$act->sugar_bean->color : '';
}
if ($item['module_name'] == 'stic_Work_Calendar') {
// STIC-Custom 20241004 MHP - Exclude canceled work calendar records from Activity Calendar
// https://github.com/SinergiaTIC/SinergiaCRM/pull/425
if ($act->sugar_bean->type == 'canceled' ) {
continue;
} else {
// END STIC-Custom
// if ($act->sugar_bean->type == 'canceled' ) {
// break;
// } else {
$item['event_type'] = $act->sugar_bean->type;
$totalMinutes = $act->sugar_bean->duration * 60;
$item['duration_hours'] = floor($totalMinutes / 60);
$item['duration_minutes'] = round($totalMinutes - $item['duration_hours'] * 60);
$item['rendering'] = 'background';
}
// }
}
// END STIC-Custom

Expand Down
6 changes: 6 additions & 0 deletions custom/modules/Calendar/CalendarActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ public static function get_activities(
$act = new CustomCalendarActivity($focusBean);

if (!empty($act)) {
// STIC-Custom 20241004 MHP - Exclude cancelled work calendar records from displaying them in the Activity Calendar
// https://github.com/SinergiaTIC/SinergiaCRM/pull/425
if ($act->sugar_bean->module_dir === 'stic_Work_Calendar' && $act->sugar_bean->type == 'canceled' ) {
continue;
}
// END STIC-Custom
$act_list[] = $act;
}
}
Expand Down

0 comments on commit 6ae1c4f

Please sign in to comment.