mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-21 11:24:40 +02:00
Merge branch 'master' into log_detail_page
This commit is contained in:
commit
4c6ceab8e8
291 changed files with 1994 additions and 1621 deletions
|
@ -22,9 +22,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\DataTables\Column;
|
||||
|
||||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\Base\AbstractNamedDBElement;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Services\EntityURLGenerator;
|
||||
use Omines\DataTablesBundle\Column\AbstractColumn;
|
||||
use Symfony\Component\OptionsResolver\Options;
|
||||
|
|
|
@ -31,7 +31,7 @@ use Omines\DataTablesBundle\Column\AbstractColumn;
|
|||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
/**
|
||||
* Similar to the built in DateTimeColumn, but the datetime is formatted using a IntlDateFormatter,
|
||||
* Similar to the built-in DateTimeColumn, but the datetime is formatted using a IntlDateFormatter,
|
||||
* to get prettier locale based formatting.
|
||||
*/
|
||||
class LocaleDateTimeColumn extends AbstractColumn
|
||||
|
@ -45,7 +45,9 @@ class LocaleDateTimeColumn extends AbstractColumn
|
|||
{
|
||||
if (null === $value) {
|
||||
return $this->options['nullValue'];
|
||||
} elseif (!$value instanceof DateTimeInterface) {
|
||||
}
|
||||
|
||||
if (!$value instanceof DateTimeInterface) {
|
||||
$value = new DateTime((string) $value);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class PrettyBoolColumn extends AbstractColumn
|
|||
return (bool) $value;
|
||||
}
|
||||
|
||||
public function render($value, $context)
|
||||
public function render($value, $context): string
|
||||
{
|
||||
if ($value === true) {
|
||||
return '<span class="badge bg-success"><i class="fa-solid fa-circle-check fa-fw"></i> '
|
||||
|
|
|
@ -27,7 +27,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
class RowClassColumn extends AbstractColumn
|
||||
{
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): self
|
||||
{
|
||||
parent::configureOptions($resolver);
|
||||
|
||||
|
@ -48,6 +48,9 @@ class RowClassColumn extends AbstractColumn
|
|||
parent::initialize('$$rowClass', $index, $options, $dataTable); // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function normalize($value)
|
||||
{
|
||||
return $value;
|
||||
|
|
|
@ -33,7 +33,7 @@ class SIUnitNumberColumn extends AbstractColumn
|
|||
$this->formatter = $formatter;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): self
|
||||
{
|
||||
parent::configureOptions($resolver);
|
||||
|
||||
|
@ -43,7 +43,7 @@ class SIUnitNumberColumn extends AbstractColumn
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function normalize($value)
|
||||
public function normalize($value): string
|
||||
{
|
||||
//Ignore null values
|
||||
if ($value === null) {
|
||||
|
|
|
@ -28,7 +28,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
*/
|
||||
class SelectColumn extends AbstractColumn
|
||||
{
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): self
|
||||
{
|
||||
parent::configureOptions($resolver);
|
||||
|
||||
|
@ -43,12 +43,15 @@ class SelectColumn extends AbstractColumn
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function normalize($value)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function render($value, $context)
|
||||
public function render($value, $context): string
|
||||
{
|
||||
//Return empty string, as it this column is filled by datatables on client side
|
||||
return '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue