/**
  * Force running a task
  *
  * @param $tasks_id integer id of the task
  *
  * @return number uniqid
  *
  **/
 function forceRunningTask($tasks_id)
 {
     global $DB;
     $uniqid = '';
     if ($this->reinitializeTaskjobs($tasks_id, 1)) {
         $pfTaskjob = new PluginFusioninventoryTaskjob();
         $_SESSION['glpi_plugin_fusioninventory']['agents'] = array();
         $query = "SELECT `" . $pfTaskjob->getTable() . "`.*,\n               `glpi_plugin_fusioninventory_tasks`.`communication`,\n               UNIX_TIMESTAMP(datetime_start) as date_scheduled_timestamp\n            FROM " . $pfTaskjob->getTable() . "\n            LEFT JOIN `glpi_plugin_fusioninventory_tasks`\n               ON `plugin_fusioninventory_tasks_id`=`glpi_plugin_fusioninventory_tasks`.`id`\n            WHERE `is_active`='1'\n               AND `status` = '0'\n               AND `glpi_plugin_fusioninventory_tasks`.`id`='" . $tasks_id . "'\n               AND `" . $pfTaskjob->getTable() . "`.`plugins_id` != '0'\n               AND `" . $pfTaskjob->getTable() . "`.`method` IS NOT NULL\n               AND `" . $pfTaskjob->getTable() . "`.`method` != ''\n            ORDER BY `id`";
         $result = $DB->query($query);
         while ($data = $DB->fetch_array($result)) {
             //            $plugin = new Plugin();
             //            $plugin->getFromDB($data['plugins_id']);
             //            if ($plugin->fields['state'] == Plugin::ACTIVATED) {
             $uniqid = $pfTaskjob->prepareRunTaskjob($data);
             //            }
         }
         foreach (array_keys($_SESSION['glpi_plugin_fusioninventory']['agents']) as $agents_id) {
             $pfTaskjob->startAgentRemotly($agents_id);
         }
         unset($_SESSION['glpi_plugin_fusioninventory']['agents']);
     } else {
         $_SESSION["MESSAGE_AFTER_REDIRECT"] = __('Unable to run task because some jobs is running yet!', 'fusioninventory');
     }
     return $uniqid;
 }