static function replayRulesCatalog($item)
 {
     global $DB;
     $datas = getAllDatasFromTable("glpi_plugin_monitoring_componentscatalogs_rules", "`plugin_monitoring_componentscalalog_id`='" . $item->getID() . "'");
     $pmComponentscatalog_rule = new PluginMonitoringComponentscatalog_rule();
     foreach ($datas as $data) {
         $pmComponentscatalog_rule->getFromDB($data['id']);
         PluginMonitoringComponentscatalog_rule::getItemsDynamicly($pmComponentscatalog_rule);
     }
 }
예제 #2
0
파일: hook.php 프로젝트: geldarr/hack-space
function plugin_monitoring_MassiveActionsProcess($data)
{
    switch ($data['action']) {
        case "plugin_monitoring_activatehosts":
            if ($data['itemtype'] == "Computer") {
                $pmHost = new PluginMonitoringHost();
                foreach ($data['item'] as $key => $val) {
                    if ($val == '1') {
                        $pmHost->massiveactionAddHost($data['itemtype'], $key, $data['template_id']);
                    }
                }
            }
            break;
        case 'plugin_monitoring_playrule_componentscatalog':
            $pmComponentscatalog_rule = new PluginMonitoringComponentscatalog_rule();
            foreach ($data['item'] as $key => $val) {
                $a_rules = $pmComponentscatalog_rule->find("`plugin_monitoring_componentscalalog_id`='" . $key . "'");
                foreach ($a_rules as $data) {
                    $pmComponentscatalog_rule->getFromDB($data['id']);
                    PluginMonitoringComponentscatalog_rule::getItemsDynamicly($pmComponentscatalog_rule);
                }
            }
            break;
        case 'plugin_monitoring_playrule_displayview':
            $pmDisplayview_rule = new PluginMonitoringDisplayview_rule();
            foreach ($data['item'] as $key => $val) {
                $a_rules = $pmDisplayview_rule->find("`plugin_monitoring_displayviews_id`='" . $key . "'");
                foreach ($a_rules as $data) {
                    $pmDisplayview_rule->getFromDB($data['id']);
                    PluginMonitoringDisplayview_rule::getItemsDynamicly($pmDisplayview_rule);
                }
            }
            break;
    }
}