From fd4bdd4997e9e5f2bd3070a5275c1550b2003684 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 5 Dec 2023 09:56:32 -0700 Subject: [PATCH] Timesheet: Use regular account select for user / owner for large numbers of users --- timesheet/inc/class.timesheet_ui.inc.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index 162053850a..7f25579ab4 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -496,6 +496,13 @@ class timesheet_ui extends timesheet_bo Events::OVERALL|Events::PAUSE => 'pause', ]; $sel_options['ts_owner'] = $edit_grants; + // Special handling for if you have a LOT of accounts - use a regular account widget + if(count($sel_options['ts_owner']) > Accounts::HUGE_LIMIT) + { + unset($sel_options['ts_owner']); + $etpl->setElementAttribute('ts_owner', 'type', 'et2-select-account'); + $etpl->setElementAttribute('ts_owner', 'accountType', 'accounts'); + } $sel_options['ts_status'] = $this->get_status_labels($only_admin_edit); if($this->config_data['history'] && $content['ts_status'] == self::DELETED_STATUS) { @@ -1036,6 +1043,13 @@ class timesheet_ui extends timesheet_bo array('value' => 0, 'label' => lang('None'))), 'ts_status' => $this->status_labels + array(lang('No status')), ); + // Special handling for if you have a LOT of accounts - use a regular account widget + if(count($sel_options['ts_owner']) > Accounts::HUGE_LIMIT) + { + unset($sel_options['ts_owner']); + $etpl->setElementAttribute('ts_owner', 'type', 'et2-nextmatch-header-account'); + $etpl->setElementAttribute('ts_owner', 'accountType', 'accounts'); + } if($this->config_data['history']) { $sel_options['ts_status'][self::DELETED_STATUS] = 'Deleted';