Skip to content

Commit

Permalink
fix(dropdown): show ID in items
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Nov 6, 2019
1 parent 1ff2849 commit dc402d9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
1 change: 1 addition & 0 deletions inc/fields/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public function displayField($canEdit = true) {
'value' => $this->value,
'comments' => false,
'entity' => $_SESSION['glpiactiveentities'],
'displaywith' => ['id'],
'rand' => $rand];

$dparams_cond_crit = [];
Expand Down
4 changes: 4 additions & 0 deletions inc/targetbase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ abstract class PluginFormcreatorTargetBase extends CommonDBChild implements
/** @var boolean $skipCreateActors Flag to disable creation of actors after creation of the item */
protected $skipCreateActors = false;

function isEntityAssign() {
return false;
}

abstract public function export($remove_uuid = false);

abstract public function save(PluginFormcreatorFormAnswer $formanswer);
Expand Down
28 changes: 8 additions & 20 deletions inc/targetticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ protected function showCompositeTicketSettings($rand) {
echo '<span id="plugin_formcreator_link_ticket">';
$linkparam = [
'name' => '_link_tickets_id',
'rand' => $rand,
'used' => $excludedTicketIds,
'displaywith' => ['id'],
'display' => false
Expand All @@ -272,28 +273,15 @@ protected function showCompositeTicketSettings($rand) {
// dropdown of target tickets
echo '<span id="plugin_formcreator_link_target">';
$condition = [
'id' => new QuerySubQuery([
'SELECT' => ['items_id'],
'FROM' => 'glpi_plugin_formcreator_targets AS t1',
'WHERE' => [
't1.itemtype' => 'PluginFormcreatorTargetTicket',
'plugin_formcreator_forms_id' => new QuerySubQuery([
'SELECT' => ['plugin_formcreator_forms_id'],
'FROM' => 'glpi_plugin_formcreator_targets AS t2',
'WHERE' => [
't2.itemtype' => 'PluginFormcreatorTargetTicket',
't2.items_id' => $targetTicketId
]
]),
]
]),
'plugin_formcreator_forms_id' => $this->fields['plugin_formcreator_forms_id']
];
echo PluginFormcreatorTargetTicket::dropdown([
'name' => '_link_targettickets_id',
'rand' => $rand,
'display' => false,
'used' => $excludedTargetTicketsIds,
'condition' => $condition,
'name' => '_link_targettickets_id',
'rand' => $rand,
'display' => false,
'used' => $excludedTargetTicketsIds,
'displaywith' => ['id'],
'condition' => $condition,
]);
echo '</span>';
echo '</div>';
Expand Down

0 comments on commit dc402d9

Please sign in to comment.