Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(task): policies dropdown on GLPI UI
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry authored and DIOHz0r committed May 30, 2018
1 parent 863ebae commit bc8f6dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion inc/policy.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static function dropdown($options = []) {
$currentCategory = '';
foreach ($DB->request($request) as $row) {
$categoryName = $category[$row['plugin_flyvemdm_policycategories_id']];
$elements[$categoryName][] = $row['name'];
$elements[$categoryName][$row['id']] = $row['name'];
}
return Dropdown::showFromArray(static::getForeignKeyField(), $elements, $options);
}
Expand Down
13 changes: 7 additions & 6 deletions inc/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,13 @@ static function showForNotifiable(CommonDBTM $item, $withtemplate = '') {
if ((empty($withtemplate) || ($withtemplate != 2))
&& $canedit) {
$policyDropdown = PluginFlyvemdmPolicy::dropdown([
'display' => false,
'name' => 'plugin_flyvemdm_policies_id',
'toupdate' => [
'value_fieldname' => 'value',
'to_update' => 'plugin_flyvemdm_policy_value',
'url' => $CFG_GLPI['root_doc'] . "/plugins/flyvemdm/ajax/policyValue.php",
'display' => false,
'name' => 'plugin_flyvemdm_policies_id',
'display_emptychoice' => true,
'toupdate' => [
'value_fieldname' => 'value',
'to_update' => 'plugin_flyvemdm_policy_value',
'url' => $CFG_GLPI['root_doc'] . "/plugins/flyvemdm/ajax/policyValue.php",
],
]);
}
Expand Down

0 comments on commit bc8f6dc

Please sign in to comment.