@@ -85,12 +85,43 @@ function plugin_formcreator_addDefaultJoin($itemtype, $ref_table, &$already_link
85
85
case PluginFormcreatorIssue::class:
86
86
// Get default joins for tickets
87
87
$ join = Search::addDefaultJoin (Ticket::getType (), Ticket::getTable (), $ already_link_tables );
88
- $ join .= Search::addLeftJoin ($ itemtype , $ ref_table , $ already_link_tables , Group::getTable (), 'groups_id_validator ' );
88
+ // $join .= Search::addLeftJoin($itemtype, $ref_table, $already_link_tables, Group::getTable(), 'groups_id_validator');
89
89
// but we want to join in issues
90
90
$ join = str_replace ('`glpi_tickets`.`id` ' , '`glpi_plugin_formcreator_issues`.`itemtype` = "Ticket" AND `glpi_plugin_formcreator_issues`.`items_id` ' , $ join );
91
91
$ join = str_replace ('`glpi_tickets` ' , '`glpi_plugin_formcreator_issues` ' , $ join );
92
92
$ join = str_replace ('`users_id_recipient` ' , '`requester_id` ' , $ join );
93
- }
93
+ $ issueSo = Search::getOptions ($ itemtype );
94
+ $ join .= Search::addLeftJoin (
95
+ $ itemtype ,
96
+ $ ref_table ,
97
+ $ already_link_tables ,
98
+ $ issueSo [9 ]['table ' ],
99
+ 'users_id_validator ' ,
100
+ 0 ,
101
+ 0 ,
102
+ $ issueSo [9 ]['joinparams ' ]
103
+ );
104
+ $ join .= Search::addLeftJoin (
105
+ $ itemtype ,
106
+ $ ref_table ,
107
+ $ already_link_tables ,
108
+ $ issueSo [11 ]['table ' ],
109
+ 'users_id_validate ' ,
110
+ 0 ,
111
+ 0 ,
112
+ $ issueSo [11 ]['joinparams ' ]
113
+ );
114
+ $ join .= Search::addLeftJoin (
115
+ $ itemtype ,
116
+ $ ref_table ,
117
+ $ already_link_tables ,
118
+ $ issueSo [16 ]['table ' ],
119
+ 'groups_id_validator ' ,
120
+ 0 ,
121
+ 0 ,
122
+ $ issueSo [16 ]['joinparams ' ]
123
+ );
124
+ }
94
125
return $ join ;
95
126
}
96
127
0 commit comments