Skip to content

Commit

Permalink
Attendance - Add option to set duration in calendar - refs BT#20363
Browse files Browse the repository at this point in the history
  • Loading branch information
cfasanando committed Dec 23, 2022
1 parent 8a0f8fd commit 4bc09b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main/inc/lib/attendance.lib.php
Expand Up @@ -1964,6 +1964,10 @@ public function attendance_repeat_calendar_add(
*/
public static function getAttendanceCalendarExtraFieldValue($variable, $calendarId)
{
if (true !== api_get_configuration_value('attendance_calendar_set_duration')) {
return false;
}

$extraFieldValues = new ExtraFieldValue('attendance_calendar');
$result = $extraFieldValues->get_values_by_handler_and_field_variable($calendarId, $variable);
if (!empty($result['value'])) {
Expand Down
4 changes: 4 additions & 0 deletions main/install/configuration.dist.php
Expand Up @@ -2321,6 +2321,10 @@
// Create a document extra field with field label "can_be_downloaded" of type "Checkbox options".
// $_configuration['documents_hide_download_icon'] = false;

// It adds option to define duration for a calendar in attendance sheet.
// Create an attendance calendar extra field with field label "duration" of type "text".
// $_configuration['attendance_calendar_set_duration'] = false;

// Enable comments in attendance sheet for users
// Require DB changes:
// ALTER TABLE c_attendance_sheet ADD comment longtext NULL;
Expand Down

0 comments on commit 4bc09b1

Please sign in to comment.