Skip to content

Commit

Permalink
Merge branch 'support/2.13.0' into support/2.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Mar 21, 2024
2 parents e3e4ef1 + 15907b8 commit 4ab2056
Show file tree
Hide file tree
Showing 14 changed files with 1,332 additions and 229 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
<a name="2.13.9"></a>
## [HEAD](https://github.com/pluginsGLPI/formcreator/compare/2.13.8..2.13.9) (2024-03-13)


### Bug Fixes

* prevent issue when response body has blank characters ([1b141a3fa](https://github.com/pluginsGLPI/formcreator/commit/1b141a3fa))
* **command:** typos ([2681eca61](https://github.com/pluginsGLPI/formcreator/commit/2681eca61))
* **dropdownfield:** ambiguous column in SQL query ([3c0630554](https://github.com/pluginsGLPI/formcreator/commit/3c0630554))
* **dropdownfield:** incomplete group restriction ([eebcc21f1](https://github.com/pluginsGLPI/formcreator/commit/eebcc21f1))
* **formansswer:** keep tickets on delete ([b3cc8d2b9](https://github.com/pluginsGLPI/formcreator/commit/b3cc8d2b9))
* **formanswer:** translate section name for targets ([cb9ce0fb6](https://github.com/pluginsGLPI/formcreator/commit/cb9ce0fb6))
* **hiddenfield:** escaping problem when displaying default value in question designer ([3818383e1](https://github.com/pluginsGLPI/formcreator/commit/3818383e1))
* **install:** dashboard setup with pre 2.13.7 appearance ([08d3871e1](https://github.com/pluginsGLPI/formcreator/commit/08d3871e1))
* **issue:** deduplicate rows whern showing technicians in issues ([8bc96d3dc](https://github.com/pluginsGLPI/formcreator/commit/8bc96d3dc))
* **issue:** prevent list of all issues in search engine ([55530d976](https://github.com/pluginsGLPI/formcreator/commit/55530d976))
* **reminder:** visibility ([826881427](https://github.com/pluginsGLPI/formcreator/commit/826881427))
* **target_actor:** duplicate failure with gours, supliers or users ([d77cde058](https://github.com/pluginsGLPI/formcreator/commit/d77cde058))
* **target_actor:** groups duplication ([dbfcc796b](https://github.com/pluginsGLPI/formcreator/commit/dbfcc796b))
* **targetticket:** set location may fail ([75144be06](https://github.com/pluginsGLPI/formcreator/commit/75144be06))
* **textarea:** support for min/max size and regex ([09682e9b8](https://github.com/pluginsGLPI/formcreator/commit/09682e9b8))


### Features

* **glpiselectfield:** support Cluster itemtype ([e72e2603c](https://github.com/pluginsGLPI/formcreator/commit/e72e2603c))



<a name="2.13.8"></a>
## [2.13.8](https://github.com/pluginsGLPI/formcreator/compare/2.13.7..2.13.8) (2023-111-08)

Expand Down
2 changes: 1 addition & 1 deletion inc/field/actorfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function getRenderedHtml($domain, $canEdit = true): string {
'display_emptychoice' => false,
'values' => array_keys($value),
'valuesnames' => array_values($value),
'_idor_token' => Session::getNewIDORToken(User::getType()),
'_idor_token' => Session::getNewIDORToken(User::getType(), ['entity_restrict' => -1]),
];
$html .= \PluginFormcreatorCommon::jsAjaxDropdown(
$fieldName . '[]',
Expand Down
12 changes: 12 additions & 0 deletions inc/field/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,22 @@ public function getRenderedHtml($domain, $canEdit = true): string {
$dparams = [];
$dparams = $this->buildParams($rand);
$dparams['display'] = false;
<<<<<<< HEAD
$dparams['_idor_token'] = Session::getNewIDORToken($itemtype);
if (version_compare(GLPI_VERSION, '10.1') >= 0 && $item->isField('states_id')) {
$dparams['condition'] = State::getDisplayConditionForAssistance();
}
=======

$idor_params = [];
foreach (['condition', 'displaywith', 'entity_restrict', 'right'] as $sensitive_param) {
if (array_key_exists($sensitive_param, $dparams)) {
$idor_params[$sensitive_param] = $dparams[$sensitive_param];
}
}
$dparams['_idor_token'] = Session::getNewIDORToken($itemtype, $idor_params);

>>>>>>> support/2.13.0
$html .= $itemtype::dropdown($dparams);
$html .= PHP_EOL;
$html .= Html::scriptBlock("$(function() {
Expand Down
14 changes: 12 additions & 2 deletions inc/form_validator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,13 @@ public static function dropdownValidatorUser(): string {
'entity_restrict' => -1,
'itemtype' => User::getType(),
'condition' => Dropdown::addNewCondition($usersCondition),
'_idor_token' => Session::getNewIDORToken(User::getType()),
];
$params['_idor_token'] = Session::getNewIDORToken(
User::getType(),
[
'condition' => $params['condition'],
]
);

return Html::jsAjaxDropdown(
'_validator_users[]',
Expand Down Expand Up @@ -520,8 +525,13 @@ public static function dropdownValidatorGroup(): string {
'itemtype' => Group::getType(),
'condition' => Dropdown::addNewCondition($groupsCondition),
'display_emptychoice' => false,
'_idor_token' => Session::getNewIDORToken(Group::getType()),
];
$params['_idor_token'] = Session::getNewIDORToken(
Group::getType(),
[
'condition' => $params['condition'],
]
);

return Html::jsAjaxDropdown(
'_validator_groups[]',
Expand Down
6 changes: 4 additions & 2 deletions inc/section.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ public function prepareInputForUpdate($input) {
$input['uuid'] = plugin_formcreator_getUuid();
}

if (!$this->checkConditionSettings($input)) {
$input['show_rule'] = PluginFormcreatorCondition::SHOW_RULE_ALWAYS;
if (!$this->skipChecks) {
if (!$this->checkConditionSettings($input)) {
$input['show_rule'] = PluginFormcreatorCondition::SHOW_RULE_ALWAYS;
}
}

return $input;
Expand Down
Loading

0 comments on commit 4ab2056

Please sign in to comment.