mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Fixed some inspection issues.
This commit is contained in:
parent
e2f7aafa2d
commit
3fe452626d
9 changed files with 25 additions and 27 deletions
|
@ -585,9 +585,9 @@ class Part extends AttachmentContainingDBElement
|
|||
|
||||
if (\is_string($delimeter)) {
|
||||
return implode($delimeter, $supplier_names);
|
||||
} else {
|
||||
return $supplier_names;
|
||||
}
|
||||
|
||||
return $supplier_names;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -286,9 +286,9 @@ class PermissionsEmbed
|
|||
|
||||
if (self::DISALLOW == $value) {
|
||||
return false;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,10 +40,10 @@ use Doctrine\ORM\PersistentCollection;
|
|||
*/
|
||||
abstract class StructuralDBElement extends AttachmentContainingDBElement
|
||||
{
|
||||
const ID_ROOT_ELEMENT = 0;
|
||||
public const ID_ROOT_ELEMENT = 0;
|
||||
|
||||
//This is a not standard character, so build a const, so a dev can easily use it
|
||||
const PATH_DELIMITER_ARROW = ' → ';
|
||||
public const PATH_DELIMITER_ARROW = ' → ';
|
||||
|
||||
// We can not define the mapping here or we will get an exception. Unfortunatly we have to do the mapping in the
|
||||
// subclasses
|
||||
|
@ -146,9 +146,7 @@ abstract class StructuralDBElement extends AttachmentContainingDBElement
|
|||
*/
|
||||
public function getComment(bool $parse_bbcode = true): string
|
||||
{
|
||||
$val = htmlspecialchars($this->comment ?? '');
|
||||
|
||||
return $val;
|
||||
return htmlspecialchars($this->comment ?? '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -217,15 +215,15 @@ abstract class StructuralDBElement extends AttachmentContainingDBElement
|
|||
|
||||
if (!$recursive) {
|
||||
return $this->children;
|
||||
} else {
|
||||
$all_elements = array();
|
||||
foreach ($this->children as $subelement) {
|
||||
$all_elements[] = $subelement;
|
||||
$all_elements = array_merge($all_elements, $subelement->getSubelements(true));
|
||||
}
|
||||
|
||||
return $all_elements;
|
||||
}
|
||||
|
||||
$all_elements = array();
|
||||
foreach ($this->children as $subelement) {
|
||||
$all_elements[] = $subelement;
|
||||
$all_elements = array_merge($all_elements, $subelement->getSubelements(true));
|
||||
}
|
||||
|
||||
return $all_elements;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
|
@ -76,12 +76,10 @@ class ElementPermissionListener
|
|||
$annotation = $reader->getPropertyAnnotation($property,
|
||||
ColumnSecurity::class);
|
||||
|
||||
if (null !== $annotation) {
|
||||
//Check if user is allowed to read info, otherwise apply placeholder
|
||||
if (!$this->security->isGranted($annotation->getReadOperationName(), $element)) {
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($element, $annotation->getPlaceholder());
|
||||
}
|
||||
//Check if user is allowed to read info, otherwise apply placeholder
|
||||
if ((null !== $annotation) && !$this->security->isGranted($annotation->getReadOperationName(), $element)) {
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($element, $annotation->getPlaceholder());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter;
|
|||
*/
|
||||
class PartVoter extends ExtendedVoter
|
||||
{
|
||||
const READ = 'read';
|
||||
public const READ = 'read';
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
|
|
|
@ -109,5 +109,7 @@ class EntityURLGenerator
|
|||
if ($entity instanceof NamedDBElement) {
|
||||
return sprintf('<a href="%s">%s</a>', $href, $entity->getName());
|
||||
}
|
||||
|
||||
throw new EntityNotSupported('The given entity is not supported yet!');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<img src="{{ main_image }}" class="img-fluid img-thumbnail bg-light" height="300" width="300">
|
||||
<img src="{{ main_image }}" class="img-fluid img-thumbnail bg-light" alt="Part main image" height="300" width="300">
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<h5 class="text-muted pt-2" title="{% trans %}manufacturer.label{% endtrans %}">{{ part.manufacturer.name ?? ""}}</h5>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="card-body row">
|
||||
<div class="col-md-2">
|
||||
<div class="img-thumbnail">
|
||||
<img class="img-fluid img-rounded" src="{{ avatar }}">
|
||||
<img class="img-fluid img-rounded" alt="User avatar" src="{{ avatar }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="{{ app.request.locale }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue