Skip to content

Commit 8510362

Browse files
committed
Rebased and added only necessary things
Rebased myself to upstream main branch Edited only two files: -container.php that fixes formatting of field -field.class.php that fixes issue with field not respecting hiding condition in simple view
1 parent ebd334f commit 8510362

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

ajax/container.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,19 @@
5656

5757
$display_condition = new PluginFieldsContainerDisplayCondition();
5858
if ($display_condition->computeDisplayContainer($item, $containers_id)) {
59+
$field_options = [
60+
'label_class' => 'col-lg-3',
61+
'input_class' => 'col-lg-9',
62+
];
63+
echo "<div class='offset-md-1 col-md-8 col-xxl-6'>";
5964
PluginFieldsField::showDomContainer(
6065
$containers_id,
6166
$item,
6267
$type,
6368
$subtype,
69+
$field_options,
6470
);
71+
echo "</div>";
6572
} else {
6673
echo '';
6774
}

inc/field.class.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,12 @@ public static function showForTab($params)
887887
{
888888
$item = $params['item'];
889889

890+
if ($item->fields['type'] == "") {
891+
$item->fields['type'] = $params['options']['type'];
892+
}
893+
if ($item->fields['itilcategories_id'] == "") {
894+
$item->fields['itilcategories_id'] = $params['options']['itilcategories_id'];
895+
}
890896
$functions = array_column(debug_backtrace(), 'function');
891897
$subtype = isset($_SESSION['glpi_tabs'][strtolower($item::getType())]) ? $_SESSION['glpi_tabs'][strtolower($item::getType())] : '';
892898
$type = substr($subtype, -strlen('$main')) === '$main'
@@ -956,7 +962,7 @@ public static function showForTab($params)
956962
}
957963

958964
$html_id = 'plugin_fields_container_' . mt_rand();
959-
if (strpos($current_url, 'helpdesk.public.php') !== false) {
965+
if (strpos($current_url, 'helpdesk.public.php') !== false || strpos($current_url, 'tracking.injector.php') !== false) {
960966
echo "<div id='{$html_id}' class='card-body row mx-0' style='border-top:0'>";
961967
echo "<div class='offset-md-1 col-md-8 col-xxl-6'>";
962968
$field_options = [
@@ -976,7 +982,7 @@ public static function showForTab($params)
976982
$field_options ?? [],
977983
);
978984
}
979-
if (strpos($current_url, 'helpdesk.public.php') !== false) {
985+
if (strpos($current_url, 'helpdesk.public.php') !== false || strpos($current_url, 'tracking.injector.php') !== false) {
980986
echo '</div>';
981987
}
982988
echo '</div>';

0 commit comments

Comments
 (0)