Ejemplo n.º 1
0
 /**
  *
  * getWarning $query are in the form:
  * <pre>
  * Array
  * (
  * [0] => Array
  *     (
  *         [id_segment] => 2224900
  *     ),
  * [1] => Array
  *     (
  *         [id_segment] => 2224903
  *     ),
  * )
  * </pre>
  */
 private function __globalWarningsCall()
 {
     $result = getWarning($this->__postInput->id_job, $this->__postInput->password);
     foreach ($result as $position => &$item) {
         $item = $item['id_segment'];
     }
     $this->result['details'] = array_values($result);
     $this->result['token'] = $this->__postInput->token;
     //        $msg = 'MateCat will be undergoing scheduled maintenance starting on Saturday, December 13 at 11:50 PM CEST. MateCat will be unavailable for approximately 4 hours.<br /> We apologize for any inconvenience. For any questions, contact us support@matecat.com.';
     //        $this->result['messages']  = '[{"msg":"' . $msg . '", "token":"' . md5($msg) . '", "expire":"2014-12-14 04:00:00"}]';
     $tMismatch = getTranslationsMismatches($this->__postInput->id_job, $this->__postInput->password);
     //        Log::doLog( $tMismatch );
     $result = array('total' => count($tMismatch), 'mine' => 0, 'list_in_my_job' => array());
     foreach ($tMismatch as $row) {
         if (!empty($row['first_of_my_job'])) {
             $result['mine']++;
             $result['list_in_my_job'][] = $row['first_of_my_job'];
             //                $result['list_in_my_job'][] = array_shift( explode( "," , $row['first_of_my_job'] ) );
             //append to global list
             $this->result['details'][] = $row['first_of_my_job'];
             //                $this->result[ 'details' ] = array_merge( $this->result[ 'details' ], explode( "," , $row['first_of_my_job'] )  )
         }
     }
     //???? php maps internally numerical keys of array_unique as string so with json_encode
     //it become an object and not an array!!
     $this->result['details'] = array_values(array_unique($this->result['details']));
     $this->result['translation_mismatches'] = $result;
 }
                    default:
                        foreach ($bugSet as $bug) {
                            $bugString .= $bug['link_to_bts'] . '<br/>';
                        }
                        break;
                }
                unset($bugSet);
            }
            $out[$odx]['bugString'] = $bugString;
        }
        $odx++;
    }
    $gui->dataSet = $out;
    unset($out);
} else {
    $gui->warning_msg = getWarning($args->type, $statusCode);
}
// Time tracking
//$chronos[] = microtime(true);$tnow = end($chronos);$tprev = prev($chronos);
//$t_elapsed_abs = number_format( $tnow - $tstart, 4);
//$t_elapsed = number_format( $tnow - $tprev, 4);
//echo '<br>' . __FUNCTION__ . ' Elapsed relative (sec):' . $t_elapsed . ' Elapsed ABSOLUTE (sec):' . $t_elapsed_abs .'<br>';
//reset($chronos);
//$mem['usage'][] = memory_get_usage(true); $mem['peak'][] = memory_get_peak_usage(true);
//echo '<br>' . __FUNCTION__ . ' Mem:' . end($mem['usage']) . ' Peak:' . end($mem['peak']) .'<br>';
switch ($args->format) {
    case FORMAT_XLS:
        createSpreadsheet($gui, $args, $cfSet);
        break;
    default:
        $tableOptions = array('status_not_run' => $args->type == $statusCode['not_run'], 'bugInterfaceOn' => $gui->bugInterfaceOn, 'format' => $args->format, 'show_platforms' => $gui->show_platforms);
Ejemplo n.º 3
0
 /**
  *
  * getWarning $query are in the form:
  * <pre>
  * Array
  * (
  * [0] => Array
  *     (
  *         [id_segment] => 2224900
  *     ),
  * [1] => Array
  *     (
  *         [id_segment] => 2224903
  *     ),
  * )
  * </pre>
  */
 private function __globalWarningsCall()
 {
     $this->result['token'] = $this->__postInput->token;
     try {
         $result = getWarning($this->__postInput->id_job, $this->__postInput->password);
     } catch (Exception $e) {
         $this->result['details'] = array();
         $this->result['translation_mismatches'] = array('total' => 0, 'mine' => 0, 'list_in_my_job' => array());
         return;
     }
     foreach ($result as $position => &$item) {
         $item = $item['id_segment'];
     }
     $this->result['messages'] = $this->getGlobalMessage();
     $this->result['details'] = array_values($result);
     $tMismatch = getTranslationsMismatches($this->__postInput->id_job, $this->__postInput->password);
     //        Log::doLog( $tMismatch );
     $result = array('total' => count($tMismatch), 'mine' => 0, 'list_in_my_job' => array());
     foreach ($tMismatch as $row) {
         if (!empty($row['first_of_my_job'])) {
             $result['mine']++;
             $result['list_in_my_job'][] = $row['first_of_my_job'];
             //                $result['list_in_my_job'][] = array_shift( explode( "," , $row['first_of_my_job'] ) );
             //append to global list
             $this->result['details'][] = $row['first_of_my_job'];
             //                $this->result[ 'details' ] = array_merge( $this->result[ 'details' ], explode( "," , $row['first_of_my_job'] )  )
         }
     }
     //???? php maps internally numerical keys of array_unique as string so with json_encode
     //it become an object and not an array!!
     $this->result['details'] = array_values(array_unique($this->result['details']));
     $this->result['translation_mismatches'] = $result;
 }