diff options
Diffstat (limited to 'langs')
-rw-r--r-- | langs/report_tx_git.php | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/langs/report_tx_git.php b/langs/report_tx_git.php index 829f72f16..8d420153e 100644 --- a/langs/report_tx_git.php +++ b/langs/report_tx_git.php @@ -56,23 +56,8 @@ function tx_call($tx_request, $project = 'project/mageia/') $user = "filip_mageia"; $pass = "report"; -/* - // create a new cURL resource - $curl_handle = curl_init(); - // TX username and password - curl_setopt($curl_handle, CURLOPT_USERPWD, "$user:$pass"); - - // return, do not echo - curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, TRUE); - - // pass url - curl_setopt($curl_handle, CURLOPT_URL, "http://$tx_url"); - - $tx_result = curl_exec($curl_handle); - curl_close($curl_handle); -/**/ - $tx_result = file_get_contents("http://$user:$pass@$tx_url"); + $tx_result = @file_get_contents("http://$user:$pass@$tx_url"); $tx_result_array = json_decode($tx_result, TRUE); $json_last_error = json_last_error(); @@ -112,8 +97,10 @@ function build_links($git_resource_name, $language_code, $resource_type, $stat_d $links_and_num = "<a href=\"http://www.transifex.com/organization/MageiaLinux/dashboard/all_resources/"; $links_and_num .= "$language_code/#1/?s=$tx_resource_name&c=$resource_type\">Tx</a>: "; $links_and_num .= $stat_data['tx_untran']; + $links_and_num .= (0 == $stat_data['tx_untran'] ? ' - full' : ''); $links_and_num .= ', <a href="http://gitweb.mageia.org/web/' . $git_link . '">git</a>: '; $links_and_num .= $stat_data['git_untran']; + $links_and_num .= ($stat_data['num_of_all'] == $stat_data['git_untran'] ? ' - empty' : ''); return $links_and_num; } @@ -336,6 +323,7 @@ if (0 < $num_of_resources_w_difference && $num_for_switch_table_to_list > $num_o } if (array_key_exists($resource_with_tx_git_diff, $one_language_array)) { $stat_data = array(); + $stat_data['num_of_all'] = $one_language_array[$resource_with_tx_git_diff]['tx_num_of_all_strings']; $stat_data['tx_untran'] = $one_language_array[$resource_with_tx_git_diff]['tx_untranslated']; $stat_data['git_untran'] = $one_language_array[$resource_with_tx_git_diff]['git_untranslated']; @@ -373,6 +361,7 @@ if (0 < $num_of_resources_w_difference) { $miss_first = TRUE; foreach ($one_language_resources as $one_language_resource) { $stat_data = array(); + $stat_data['num_of_all'] = $one_language_array[$one_language_resource]['tx_num_of_all_strings']; $stat_data['tx_untran'] = $one_language_array[$one_language_resource]['tx_untranslated']; $stat_data['git_untran'] = $one_language_array[$one_language_resource]['git_untranslated']; @@ -395,6 +384,7 @@ if (0 < $num_of_resources_w_difference) { foreach ($tx_git_difference as $one_language => $one_language_array) { if (isset($one_language_array[$resource_with_tx_git_diff])) { $stat_data = array(); + $stat_data['num_of_all'] = $one_language_array[$resource_with_tx_git_diff]['tx_num_of_all_strings']; $stat_data['tx_untran'] = $one_language_array[$resource_with_tx_git_diff]['tx_untranslated']; $stat_data['git_untran'] = $one_language_array[$resource_with_tx_git_diff]['git_untranslated']; |