<commit_before><?php

/*
   ----------------------------------------------------------------------
   FusionInventory
   Copyright (C) 2003-2008 by the INDEPNET Development Team.

   http://www.fusioninventory.org/   http://forge.fusioninventory.org//
   ----------------------------------------------------------------------

   LICENSE

   This file is part of FusionInventory plugins.

   FusionInventory is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   FusionInventory is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with FusionInventory; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   ------------------------------------------------------------------------
 */

// Original Author of file: <NAME>
// Purpose of file:
// ----------------------------------------------------------------------

class PluginFusioninventoryTaskjoblog extends CommonDBTM {

   /*
    * Define different state
    *
    * 
    * 1 : started
    * 2 : ok
    * 3 : error / replaned
    * 4 : error
    * 5 : Unknown
    * 6 : Running
    * 7 : prepared
    * 
    */


   function showHistory($taskjobs_id, $width="950") {
      global $DB,$CFG_GLPI,$LANG;

      $PluginFusioninventoryTaskjobstatus = new PluginFusioninventoryTaskjobstatus();
      $PluginFusioninventoryAgent = new PluginFusioninventoryAgent();

      $displayforceend = "0";
		echo "<script  type='text/javascript'>
function close_array(id){
	document.getElementById('plusmoins'+id).innerHTML = '<img src=\'".GLPI_ROOT."/pics/collapse.gif\''+
      'onClick=\'Effect.Fade(\"viewfollowup'+id+'\");appear_array('+id+');\' />';
}
function appear_array(id){
	document.getElementById('plusmoins'+id).innerHTML = '<img src=\'".GLPI_ROOT."/pics/expand.gif\''+
      'onClick=\'Effect.Appear(\"viewfollowup'+id+'\");close_array('+id+');\' />';
}

		</script>";

		echo "<script type='text/javascript' src='".GLPI_ROOT."/plugins/fusioninventory/prototype.js'></script>";
      echo "<script type='text/javascript' src='".GLPI_ROOT."/plugins/fusioninventory/effects.js'></script>";




      echo "<center><table class='tab_cadrehov' style='width: ".$width."px'>";
      echo "<tr>";
      echo "<th colspan='8'>".$LANG['title'][38]."</th>";
      echo "</tr>";

      $a_jobstatus = $PluginFusioninventoryTaskjobstatus->find('`plugin_fusioninventory_taskjobs_id`="'.$taskjobs_id.'" GROUP BY uniqid,plugin_fusioninventory_agents_id',
                           '`id` DESC');

      echo "<tr>";
      echo "<th></th>";
      echo "<th>Uniqid</th>";
      echo "<th>".$LANG['plugin_fusioninventory']['processes'][38]."</th>";
      echo "<th>".$LANG['plugin_fusioninventory']['agents'][28]."</th>";
      echo "<th>";
      echo $LANG['common'][27];
      echo "</th>";
      echo "<th>";
      echo $LANG['joblist'][0];
      echo "</th>";
      echo "<th>";
      echo $LANG['common'][25];
      echo "</th>";
      echo "<th></th>";
      echo "</tr>";

      foreach ($a_jobstatus as $data) {

         $a_history = $this->find('`plugin_fusioninventory_taskjobstatus_id` = "'.$data['id'].'"', 'id');

         echo "<tr class='tab_bg_1'>";
         echo "<td id='plusmoins".$data["id"]."'><img src='".GLPI_ROOT.
                  "/pics/expand.gif' onClick='Effect.Appear(\"viewfollowup".$data["id"].
                  "\");close_array(".$data["id"].");' /></td>";

         echo "<td>";
         echo $data['uniqid'];
         echo "</td>";
         echo "<td>";
         echo $data['id'];
         echo "</td>";
         echo "<td>";
         $PluginFusioninventoryAgent->getFromDB($data['plugin_fusioninventory_agents_id']);
         echo $PluginFusioninventoryAgent->getLink(1);
         echo "</td>";
         $a_return = $this->displayHistoryDetail(array_pop($a_history));
         $count = $a_return[0];
         $displayforceend += $count;
         echo $a_return[1];

         echo "<td align='center'>";
         if ($displayforceend == "0") {
            echo "<form name='form' method='post' action='".GLPI_ROOT."/plugins/fusioninventory/front/taskjob.form.php'>";
            echo "<input type='hidden' name='taskjobstatus_id' value='".$data['id']."' />";<commit_msg>Fix button display when taskjobstatus not finish when have mamy jobstatus for a tack action<commit_after><?php

/*
   ----------------------------------------------------------------------
   FusionInventory
   Copyright (C) 2003-2008 by the INDEPNET Development Team.

   http://www.fusioninventory.org/   http://forge.fusioninventory.org//
   ----------------------------------------------------------------------

   LICENSE

   This file is part of FusionInventory plugins.

   FusionInventory is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   FusionInventory is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with FusionInventory; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   ------------------------------------------------------------------------
 */

// Original Author of file: <NAME>
// Purpose of file:
// ----------------------------------------------------------------------

class PluginFusioninventoryTaskjoblog extends CommonDBTM {

   /*
    * Define different state
    *
    * 
    * 1 : started
    * 2 : ok
    * 3 : error / replaned
    * 4 : error
    * 5 : Unknown
    * 6 : Running
    * 7 : prepared
    * 
    */


   function showHistory($taskjobs_id, $width="950") {
      global $DB,$CFG_GLPI,$LANG;

      $PluginFusioninventoryTaskjobstatus = new PluginFusioninventoryTaskjobstatus();
      $PluginFusioninventoryAgent = new PluginFusioninventoryAgent();

		echo "<script  type='text/javascript'>
function close_array(id){
	document.getElementById('plusmoins'+id).innerHTML = '<img src=\'".GLPI_ROOT."/pics/collapse.gif\''+
      'onClick=\'Effect.Fade(\"viewfollowup'+id+'\");appear_array('+id+');\' />';
}
function appear_array(id){
	document.getElementById('plusmoins'+id).innerHTML = '<img src=\'".GLPI_ROOT."/pics/expand.gif\''+
      'onClick=\'Effect.Appear(\"viewfollowup'+id+'\");close_array('+id+');\' />';
}

		</script>";

		echo "<script type='text/javascript' src='".GLPI_ROOT."/plugins/fusioninventory/prototype.js'></script>";
      echo "<script type='text/javascript' src='".GLPI_ROOT."/plugins/fusioninventory/effects.js'></script>";




      echo "<center><table class='tab_cadrehov' style='width: ".$width."px'>";
      echo "<tr>";
      echo "<th colspan='8'>".$LANG['title'][38]."</th>";
      echo "</tr>";

      $a_jobstatus = $PluginFusioninventoryTaskjobstatus->find('`plugin_fusioninventory_taskjobs_id`="'.$taskjobs_id.'" GROUP BY uniqid,plugin_fusioninventory_agents_id',
                           '`id` DESC');

      echo "<tr>";
      echo "<th></th>";
      echo "<th>Uniqid</th>";
      echo "<th>".$LANG['plugin_fusioninventory']['processes'][38]."</th>";
      echo "<th>".$LANG['plugin_fusioninventory']['agents'][28]."</th>";
      echo "<th>";
      echo $LANG['common'][27];
      echo "</th>";
      echo "<th>";
      echo $LANG['joblist'][0];
      echo "</th>";
      echo "<th>";
      echo $LANG['common'][25];
      echo "</th>";
      echo "<th></th>";
      echo "</tr>";

      foreach ($a_jobstatus as $data) {
         $displayforceend = 0;
         $a_history = $this->find('`plugin_fusioninventory_taskjobstatus_id` = "'.$data['id'].'"', 'id');

         echo "<tr class='tab_bg_1'>";
         echo "<td id='plusmoins".$data["id"]."'><img src='".GLPI_ROOT.
                  "/pics/expand.gif' onClick='Effect.Appear(\"viewfollowup".$data["id"].
                  "\");close_array(".$data["id"].");' /></td>";

         echo "<td>";
         echo $data['uniqid'];
         echo "</td>";
         echo "<td>";
         echo $data['id'];
         echo "</td>";
         echo "<td>";
         $PluginFusioninventoryAgent->getFromDB($data['plugin_fusioninventory_agents_id']);
         echo $PluginFusioninventoryAgent->getLink(1);
         echo "</td>";
         $a_return = $this->displayHistoryDetail(array_pop($a_history));
         $count = $a_return[0];
         $displayforceend += $count;
         echo $a_return[1];

         echo "<td align='center'>";
         if ($displayforceend == "0") {
            echo "<form name='form' method='post' action='".GLPI_ROOT."/plugins/fusioninventory/front/taskjob.form.php'>";
            echo "<input type='hidden' name='taskjobstatus_id' value='".$data['id']."' />";
{'fraction_non_alphanumeric': 0.22139197267292912, 'fraction_numerical': 0.010888129803586678, 'mean_word_length': 2.4081484176064025, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 105, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6403829', 'n_tokens_mistral': 2858, 'n_tokens_neox': 2679, 'n_words': 634}