/**
  * Display actions value with preselection of action type
  *
  * @param $myname value name of dropdown
  * @param $actiontype value name of the action type selected
  * @param $method value name of the method selected
  * @param $actiontypeid value dropdown name of action type
  * @param $value value name of the definition (used for edit taskjob)
  * @param $entity_restrict restriction of entity if required
  *
  * @return value rand of the dropdown
  *
  **/
 function dropdownAction($myname, $actiontype, $method, $actiontypeid, $value = 0, $entity_restrict = '')
 {
     global $CFG_GLPI;
     $a_methods = PluginFusioninventoryStaticmisc::getmethods();
     $module = '';
     foreach ($a_methods as $datas) {
         if ($method == $datas['method']) {
             $module = $datas['module'];
         }
     }
     $rand = '';
     $class = PluginFusioninventoryStaticmisc::getStaticMiscClass($module);
     if ($actiontype == "PluginFusioninventoryAgent") {
         $actionselection_method = "task_actionselection_PluginFusioninventoryAgent_" . $method;
         if (is_callable(array($class, $actionselection_method))) {
             $rand = call_user_func(array($class, $actionselection_method));
         } else {
             $a_data = $this->get_agents($method);
             $rand = Dropdown::showFromArray('actionselectiontoadd', $a_data);
         }
     } else {
         $definitionselection_method = "task_definitionselection_" . $actiontype . "_" . $method;
         if (is_callable(array($class, $definitionselection_method))) {
             $rand = call_user_func(array($class, $definitionselection_method));
         }
     }
     $params = array('selection' => '__VALUE__', 'entity_restrict' => $entity_restrict, 'myname' => $myname, 'actionselectadd' => 'dropdown_actionselectiontoadd' . $rand, 'actiontypeid' => $actiontypeid);
     Ajax::UpdateItemOnEvent('addAObject', 'show_ActionListEmpty', $CFG_GLPI["root_doc"] . "/plugins/fusioninventory/ajax/dropdownactionselection.php", $params, array("click"));
 }