Show
Ignore:
Timestamp:
07/24/08 16:58:52 (4 months ago)
Author:
jmathis
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/centreon/www/include/eventLogs/viewLog.php

    r5860 r5912  
    5656        if (!isset($user_params["log_filter_alert"])) 
    5757                $user_params["log_filter_alert"] = 1; 
     58        if (!isset($user_params["log_filter_oh"])) 
     59                $user_params["log_filter_oh"] = 1; 
    5860         
    5961        #Path to the configuration dir 
     
    6971        $openid = '0'; 
    7072        $open_id_sub = '0'; 
    71         if(isset($_GET["openid"])){ 
     73        if (isset($_GET["openid"])){ 
    7274                $openid = $_GET["openid"]; 
    7375                $open_id_type = substr($openid, 0, 2); 
     
    7577        } 
    7678 
    77         if(isset($_GET["id"])){ 
     79        if (isset($_GET["id"])){ 
    7880                $id = $_GET["id"]; 
    7981        } else 
    8082                $id = 1; 
    81         if(isset($_POST["id"])){ 
     83        if (isset($_POST["id"])){ 
    8284                $id = $_POST["id"]; 
    8385        } else 
     
    8890                $id_svc = $_POST["svc_id"]; 
    8991                $tab_svcs = explode(",", $id_svc); 
    90                 foreach($tab_svcs as $svc) 
    91                 { 
     92                foreach ($tab_svcs as $svc){ 
    9293                        $tmp = explode(";", $svc); 
    9394                        $id .= "HS_" . getMyServiceID($tmp[1], getMyHostID($tmp[0])).","; 
     
    9697        $id_log = "'RR_0'"; 
    9798        $multi =0; 
    98         if(isset($_GET["mode"]) && $_GET["mode"] == "0"){ 
     99        if (isset($_GET["mode"]) && $_GET["mode"] == "0"){ 
    99100                $mode = 0; 
    100101                $id_log = "'".$id."'"; 
    101102                $multi =1; 
    102         } else{ 
     103        } else { 
    103104                $mode = 1; 
    104105                $id = 1; 
     
    148149        cssNode.rel = 'stylesheet'; 
    149150        cssNode.href = css_file; 
    150         cssNode.media = 'screen';headID.appendChild(cssNode); 
     151        cssNode.media = 'screen'; 
     152        headID.appendChild(cssNode); 
    151153  
    152154        var multi = <?php echo $multi; ?>; 
     
    175177                return tree.getAllChecked(); 
    176178        } 
    177         if(document.getElementById('linkBar')){ 
     179        if (document.getElementById('linkBar')){ 
    178180                var _menu_2 = document.getElementById('linkBar') 
    179181                var _divBar = document.createElement("div"); 
     
    195197        function onNodeSelect(nodeId){ 
    196198                var logView4xml = document.getElementById('logView4xml'); 
    197                 logView4xml.innerHTML="Waiting XML log"; 
     199                logView4xml.innerHTML = "Waiting XML log"; 
    198200         
    199201                tree.openItem(nodeId); 
     
    239241        var _error              = <?php echo $user_params["log_filter_error"]; ?>; 
    240242        var _alert              = <?php echo $user_params["log_filter_alert"]; ?>; 
     243         
     244        var _oh                 = <?php echo $user_params["log_filter_oh"]; ?>; 
    241245         
    242246        // Period 
     
    296300 
    297301        function log_4_host(id, formu, type){    
    298                 if(document.formu && !document.formu.period_choice[1].checked)  { 
     302                if (document.formu && !document.formu.period_choice[1].checked) { 
    299303                        period = document.formu.period.value; 
    300304                } else if(document.formu)       { 
     
    307311         
    308312                // type 
    309                 if(document.formu2 && document.formu2.notification) 
     313                if (document.formu2 && document.formu2.notification) 
    310314                        _notification = document.formu2.notification.checked; 
    311                 if(document.formu2 && document.formu2.error) 
     315                if (document.formu2 && document.formu2.error) 
    312316                        _error = document.formu2.error.checked; 
    313                 if(document.formu2 && document.formu2.alert) 
     317                if (document.formu2 && document.formu2.alert) 
    314318                        _alert = document.formu2.alert.checked; 
    315319         
    316                 if(document.formu2 && document.formu2.up) 
     320                if (document.formu2 && document.formu2.up) 
    317321                        _up = document.formu2.up.checked; 
    318                 if(document.formu2 && document.formu2.down) 
     322                if (document.formu2 && document.formu2.down) 
    319323                        _down = document.formu2.down.checked; 
    320                 if(document.formu2 && document.formu2.unreachable) 
     324                if (document.formu2 && document.formu2.unreachable) 
    321325                        _unreachable = document.formu2.unreachable.checked; 
    322326         
    323                 if(document.formu2 && document.formu2.ok) 
     327                if (document.formu2 && document.formu2.ok) 
    324328                        _ok = document.formu2.ok.checked; 
    325          
    326                 if(document.formu2 && document.formu2.warning) 
     329                if (document.formu2 && document.formu2.warning) 
    327330                        _warning = document.formu2.warning.checked; 
    328          
    329                 if(document.formu2 && document.formu2.critical) 
     331                if (document.formu2 && document.formu2.critical) 
    330332                        _critical = document.formu2.critical.checked; 
    331          
    332                 if(document.formu2 && document.formu2.unknown) 
     333                if (document.formu2 && document.formu2.unknown) 
    333334                        _unknown = document.formu2.unknown.checked; 
    334335         
    335                 if(document.formu && document.formu.StartDate.value != "") 
     336                if (document.formu && document.formu.StartDate.value != "") 
    336337                        StartDate = document.formu.StartDate.value; 
    337                 if(document.formu && document.formu.EndDate.value != "") 
     338                if (document.formu && document.formu.EndDate.value != "") 
    338339                        EndDate = document.formu.EndDate.value; 
    339340         
    340                 if(document.formu && document.formu.StartTime.value != "") 
     341                if (document.formu && document.formu.StartTime.value != "") 
    341342                        StartTime = document.formu.StartTime.value; 
    342                 if(document.formu && document.formu.EndTime.value != "") 
     343                if (document.formu && document.formu.EndTime.value != "") 
    343344                        EndTime = document.formu.EndTime.value; 
     345                 
     346                if (document.formu2 && document.formu2.oh) 
     347                        _oh = document.formu2.oh.checked; 
    344348         
    345349                tree.selectItem(id); 
     
    348352                var _addrXSL = "./include/eventLogs/log.xsl"; 
    349353 
    350                 if(!type) 
    351                 {                
    352                 var _addr = './include/eventLogs/GetODSXmlLog.php?multi='+multi+'&warning='+_warning+'&unknown='+_unknown+'&critical='+_critical+'&ok='+_ok+'&unreachable='+_unreachable+'&down='+_down+'&up='+_up+'&num='+_num+'&error='+_error+'&alert='+_alert+'&notification='+_notification+'&period='+period+'&StartDate='+StartDate+'&EndDate='+EndDate+'&StartTime='+StartTime+'&EndTime='+EndTime+'&id='+id+'&sid=<?php echo $sid;?>'; 
    353                 proc.setXml(_addr) 
    354                 proc.setXslt(_addrXSL) 
    355                 proc.transform("logView4xml"); 
    356                 } 
    357                 else{ 
    358                 var _addr = './include/eventLogs/GetODS'+type+'Log.php?multi='+multi+'&warning='+_warning+'&unknown='+_unknown+'&critical='+_critical+'&ok='+_ok+'&unreachable='+_unreachable+'&down='+_down+'&up='+_up+'&num='+_num+'&error='+_error+'&alert='+_alert+'&notification='+_notification+'&period='+period+'&StartDate='+StartDate+'&EndDate='+EndDate+'&StartTime='+StartTime+'&EndTime='+EndTime+'&id='+id+'&sid=<?php echo $sid;?>'; 
    359                 document.location.href = _addr; 
     354                if (!type){              
     355                        var _addr = './include/eventLogs/GetODSXmlLog.php?multi='+multi+'&oh='+_oh+'&warning='+_warning+'&unknown='+_unknown+'&critical='+_critical+'&ok='+_ok+'&unreachable='+_unreachable+'&down='+_down+'&up='+_up+'&num='+_num+'&error='+_error+'&alert='+_alert+'&notification='+_notification+'&period='+period+'&StartDate='+StartDate+'&EndDate='+EndDate+'&StartTime='+StartTime+'&EndTime='+EndTime+'&id='+id+'&sid=<?php echo $sid;?>'; 
     356                        proc.setXml(_addr) 
     357                        proc.setXslt(_addrXSL) 
     358                        proc.transform("logView4xml"); 
     359                } else{ 
     360                        var _addr = './include/eventLogs/GetODS'+type+'Log.php?multi='+multi+'&oh='+_oh+'&warning='+_warning+'&unknown='+_unknown+'&critical='+_critical+'&ok='+_ok+'&unreachable='+_unreachable+'&down='+_down+'&up='+_up+'&num='+_num+'&error='+_error+'&alert='+_alert+'&notification='+_notification+'&period='+period+'&StartDate='+StartDate+'&EndDate='+EndDate+'&StartTime='+StartTime+'&EndTime='+EndTime+'&id='+id+'&sid=<?php echo $sid;?>'; 
     361                        document.location.href = _addr; 
    360362                } 
    361363        } 
     
    372374    } 
    373375} 
    374  
    375376</script>