From 6d238c8564388143bc3927913cae11d913a70087 Mon Sep 17 00:00:00 2001
From: LAUNAY Samuel <107540223+Lainow@users.noreply.github.com>
Date: Tue, 23 Jan 2024 14:30:12 +0100
Subject: [PATCH 1/2] Update alignment to match glpi
---
inc/object.class.php | 30 +++++++++++-------------------
1 file changed, 11 insertions(+), 19 deletions(-)
diff --git a/inc/object.class.php b/inc/object.class.php
index 0ca19cf..8f35036 100644
--- a/inc/object.class.php
+++ b/inc/object.class.php
@@ -646,15 +646,11 @@ public function displayField($canedit, $name, $value, $template, $description =
}
$this->startColumn();
- echo $searchoption['name'];
- if (isset($searchoption['autoname']) && $searchoption['autoname'] && $template) {
- echo "* ";
- }
- $this->endColumn();
- $this->startColumn();
+ echo '';
// Keep only main column type by removing anything that is preceded by a space (e.g. " unsigned")
// or a parenthesis (e.g. "(255)").
+ echo '
';
$column_type = preg_replace('/^([a-z]+)([ (].+)*$/', '$1', $description['Type']);
switch ($column_type) {
case "int":
@@ -774,6 +770,7 @@ public function displayField($canedit, $name, $value, $template, $description =
echo "";
break;
}
+ echo '
';
$this->endColumn();
}
}
@@ -786,10 +783,14 @@ public function displayField($canedit, $name, $value, $template, $description =
public function startColumn()
{
if ($this->cpt == 0) {
- echo "";
+ echo '';
+ echo '
';
+ echo '
';
+ echo '
';
+ echo '
';
}
+ echo '
';
- echo "
";
$this->cpt++;
}
@@ -800,12 +801,7 @@ public function startColumn()
**/
public function endColumn()
{
- echo " | ";
-
- if ($this->cpt == 4) {
- echo "
";
- $this->cpt = 0;
- }
+ echo "";
}
@@ -816,11 +812,7 @@ public function endColumn()
public function closeColumn()
{
if ($this->cpt > 0) {
- while ($this->cpt < 4) {
- echo " | ";
- $this->cpt++;
- }
- echo "";
+ echo "";
}
}
From 9b4c25a7ca1633299011a52dff544d98a8263e84 Mon Sep 17 00:00:00 2001
From: LAUNAY Samuel <107540223+Lainow@users.noreply.github.com>
Date: Wed, 31 Jan 2024 10:57:15 +0100
Subject: [PATCH 2/2] Fix dropdown alignment
---
inc/object.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inc/object.class.php b/inc/object.class.php
index 8f35036..39ffb60 100644
--- a/inc/object.class.php
+++ b/inc/object.class.php
@@ -650,7 +650,7 @@ public function displayField($canedit, $name, $value, $template, $description =
// Keep only main column type by removing anything that is preceded by a space (e.g. " unsigned")
// or a parenthesis (e.g. "(255)").
- echo '';
+ echo '
';
$column_type = preg_replace('/^([a-z]+)([ (].+)*$/', '$1', $description['Type']);
switch ($column_type) {
case "int":