}
     if ($a_tasks[$task_id]['action'] == 'NETDISCOVERY' and $ptcm->isActivated('netdiscovery') and $a_agent['module_netdiscovery'] == '1') {
         $single = 1;
         $ptc->addDiscovery($pxml, 1);
         $input['ID'] = $task_id;
         $ptt->delete($input);
     }
     if ($a_tasks[$task_id]['action'] == 'SNMPQUERY' and $ptcm->isActivated('snmp') and $a_agent['module_snmpquery'] == '1') {
         $single = 1;
         $ptc->addQuery($pxml, 1);
         $input['ID'] = $task_id;
         $ptt->delete($input);
     }
     if ($a_tasks[$task_id]['action'] == 'WAKEONLAN' and $ptcm->isActivated('wol') and $a_agent['module_wakeonlan'] == '1') {
         $single = 1;
         $ptc->addWakeonlan($pxml);
         $input['ID'] = $task_id;
         $ptt->delete($input);
     }
 }
 if ($single == "0") {
     if ($a_agent['module_netdiscovery'] == '1') {
         $ptc->addDiscovery($pxml);
     }
     if ($a_agent['module_snmpquery'] == '1') {
         $ptc->addQuery($pxml);
     }
 }
 if ($ocsinventory == '1') {
     $ptc->addInventory();
 }