0, 'text' => $_REQUEST['emptylabel'])); } } } $result = PluginProcessmakerProcess::getSqlSearchResult(false, $search); if ($DB->numrows($result)) { while ($data=$DB->fetch_array($result)) { if (in_array( $_REQUEST["entity_restrict"], PluginProcessmakerProcess::getEntitiesForProfileByProcess( $data["id"], $_SESSION['glpiactiveprofile']['id'], true) )) { array_push( $processes, array( 'id' => $data["id"], 'text' => $data["name"] )); $count++; } } } $ret['results'] = $processes; $ret['count'] = $count; echo json_encode($ret);