Changeset 5839

Show
Ignore:
Timestamp:
07/23/08 10:27:58 (4 months ago)
Author:
dduponchelle
Message:

XML export added on event logs monitoring.

Location:
trunk/centreon/www/include/eventLogs
Files:
4 modified

Legend:

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

    r5791 r5839  
    5050        $xml = new SimpleXMLElement($flux); 
    5151 
    52         echo _("Begin date")."; "._("End date").";\n";           
     52        echo _("Begin date")."; "._("End date").";\n"; 
    5353        echo date('d/m/y (H:i:s)', intval($xml->infos->start)).";".date('d/m/y (H:i:s)', intval($xml->infos->end))."\n"; 
    5454        echo "\n"; 
  • trunk/centreon/www/include/eventLogs/GetODSXmlLog.php

    r5437 r5839  
    278278                foreach ($tab_id as $openid){ 
    279279                        $tab_tmp = split("_",$openid); 
    280                         $id = $tab_tmp[1]; 
     280                        #$id = $tab_tmp[1]; 
    281281                        $type = $tab_tmp[0]; 
    282282 
  • trunk/centreon/www/include/eventLogs/viewLog.ihtml

    r5813 r5839  
    3737                                  
    3838                                <a href="javascript:log_CSV()"><img src="./img/icones/16x16/text_binary_csv.gif" alt="export CSV"/></a> 
     39                                &nbsp; 
     40                                <a href="javascript:log_XML()"><img src="./img/icones/16x16/text_binary_xml.gif" alt="export XML"/></a> 
    3941                        </td> 
    4042                </tr> 
  • trunk/centreon/www/include/eventLogs/viewLog.php

    r5790 r5839  
    429429    // Here is your precious function 
    430430    // You can call as many functions as you want here; 
    431     myOnloadFunction1(); 
    432431        log_4_host(<?php echo $id_log;?>,null); 
    433432 
     
    438437} 
    439438 
    440 // Your precious function 
    441 function myOnloadFunction1() {} 
     439        // Function used to lauch the XML export 
     440 
     441        function log_XML(id, formu){     
     442                if(document.formu && !document.formu.period_choice[1].checked)  { 
     443                        period = document.formu.period.value; 
     444                } else if(document.formu)       { 
     445                        period = ''; 
     446                        StartDate = document.formu.StartDate.value; 
     447                        EndDate = document.formu.EndDate.value; 
     448                        StartTime = document.formu.StartTime.value; 
     449                        EndTime = document.formu.EndTime.value; 
     450                } 
     451                 
     452                 
     453                // type 
     454                if(document.formu2 && document.formu2.notification) 
     455                        _notification = document.formu2.notification.checked; 
     456                if(document.formu2 && document.formu2.error) 
     457                        _error = document.formu2.error.checked; 
     458                if(document.formu2 && document.formu2.alert) 
     459                        _alert = document.formu2.alert.checked; 
     460         
     461                if(document.formu2 && document.formu2.up) 
     462                        _up = document.formu2.up.checked; 
     463                if(document.formu2 && document.formu2.down) 
     464                        _down = document.formu2.down.checked; 
     465                if(document.formu2 && document.formu2.unreachable) 
     466                        _unreachable = document.formu2.unreachable.checked; 
     467         
     468                if(document.formu2 && document.formu2.ok) 
     469                        _ok = document.formu2.ok.checked; 
     470         
     471                if(document.formu2 && document.formu2.warning) 
     472                        _warning = document.formu2.warning.checked; 
     473         
     474                if(document.formu2 && document.formu2.critical) 
     475                        _critical = document.formu2.critical.checked; 
     476         
     477                if(document.formu2 && document.formu2.unknown) 
     478                        _unknown = document.formu2.unknown.checked; 
     479         
     480                if(document.formu && document.formu.StartDate.value != "") 
     481                        StartDate = document.formu.StartDate.value; 
     482                if(document.formu && document.formu.EndDate.value != "") 
     483                        EndDate = document.formu.EndDate.value; 
     484         
     485                if(document.formu && document.formu.StartTime.value != "") 
     486                        StartTime = document.formu.StartTime.value; 
     487                if(document.formu && document.formu.EndTime.value != "") 
     488                        EndTime = document.formu.EndTime.value; 
     489         
     490                tree.selectItem(id); 
     491         
     492        // send all parmeters via the URL 
     493         
     494                var _addrXML = './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+'&limit=66000&EndTime='+EndTime+'&id='+id+'&sid=<?php echo $sid;?>'; 
     495                 
     496                document.location.href = _addrXML; 
     497        } 
     498         
     499         
     500        var nowOnload = window.onload; 
     501        window.onload = function () { 
     502    // Here is your precious function 
     503    // You can call as many functions as you want here; 
     504        log_4_host(<?php echo $id_log;?>,null); 
     505 
     506    // Now we call old function which was assigned to onLoad, thus playing nice 
     507    if (nowOnload != null && typeof(nowOnload) == 'function') { 
     508        nowOnload(); 
     509    } 
     510} 
     511 
    442512</script>