diff --git a/app/AdminModule/components/UsersGridControl.php b/app/AdminModule/components/UsersGridControl.php index 51529fe2f..7d030006c 100644 --- a/app/AdminModule/components/UsersGridControl.php +++ b/app/AdminModule/components/UsersGridControl.php @@ -239,7 +239,7 @@ public function createComponentUsersGrid($name) }); foreach ($this->customInputRepository->findAllOrderedByPosition() as $customInput) { - $grid->addColumnText('customInput' . $customInput->getId(), $customInput->getName()) + $grid->addColumnText('customInput' . $customInput->getId(), $this->truncate($customInput->getName(), 35)) ->setRenderer(function ($row) use ($customInput) { $customInputValue = $row->getCustomInputValue($customInput); if ($customInputValue) { @@ -555,4 +555,14 @@ private function preparePaymentMethodFilterOptions() $options[$type] = 'common.payment.' . $type; return $options; } + + private function truncate($text, $length) { + if (strlen($text) > $length) { + $text = $text . " "; + $text = substr($text, 0, $length); + $text = substr($text, 0, strrpos($text, ' ')); + $text = $text . "..."; + } + return $text; + } } \ No newline at end of file