Esempio n. 1
0
    }
}
//DB connection
$db = new ossim_db();
$conn = $db->connect();
$ids = explode(",", $selected_incidents);
$ids_updated = array();
$size = count($ids);
if (is_array($ids) && $size > 0) {
    for ($i = 0; $i < $size; $i++) {
        $incident_id = $ids[$i];
        if ($incident_id != "" && Incident::user_incident_perms($conn, $incident_id, 'show')) {
            if ($action == 'apply_tags') {
                $res = Incident::insert_incident_tag($conn, $incident_id, $tag);
            } else {
                $res = Incident::delete_incident_tags($conn, $incident_id);
            }
            if ($res === TRUE) {
                $ids_updated[$incident_id] = $incident_id;
            }
        }
    }
    if ($action == 'apply_tags') {
        $incident_tag = new Incident_tag($conn);
        if (count($ids) != count($ids_updated)) {
            echo "OK###DB Error###" . implode(",", $ids_updated) . "###";
        } else {
            echo "OK###Tag added###";
        }
        echo "<div style='color:grey; font-size: 10px; padding-bottom: 3px;'>" . $incident_tag->get_html_tag($tag) . "</div>";
    } else {