GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Feature] Allow multiple "Insertion in the form" (dom) blocks per entity · pluginsGLPI/fields@06a3082

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .gitignore
  • front
    • container.form.php
  • inc
    • container.class.php
    • field.class.php
  • templates
    • fields.html.twig
  • tests
    • PluginFieldsContainerTest.php
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.gitignore‎

Copy file name to clipboardExpand all lines: .gitignore
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
.phpunit.result.cache
66
tests/files/
77
*.min.*
8+
*.cache
89
var/
Collapse file

‎front/container.form.php‎

Copy file name to clipboardExpand all lines: front/container.form.php
+12-1Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,18 @@
5757
} elseif (isset($_POST['update_fields_values'])) {
5858
$right = PluginFieldsProfile::getRightOnContainer($_SESSION['glpiactiveprofile']['id'], $_POST['plugin_fields_containers_id']);
5959
if ($right > READ) {
60-
$container->updateFieldsValues($_REQUEST, $_REQUEST['itemtype'], false);
60+
$containerID = $_POST['plugin_fields_containers_id'];
61+
$data = [];
62+
foreach ($_REQUEST as $key => $value) {
63+
// if key starts with plugin_fields_<containerID>_ remove the prefix
64+
if (strpos($key, "plugin_fields_{$containerID}_") === 0) {
65+
$new_key = substr($key, strlen("plugin_fields_{$containerID}_"));
66+
$data[$new_key] = $value;
67+
} else {
68+
$data[$key] = $value;
69+
}
70+
}
71+
$container->updateFieldsValues($data, $_REQUEST['itemtype'], false);
6172
}
6273

6374
Html::back();

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.