Bug 551392 - Babel Supported Languages page broken
Change-Id: Ib7d6a42c599950669df0c5df5fa32381ff06509e
Signed-off-by: Denis Roy <denis.roy@eclipse-foundation.org>
diff --git a/classes/system/feature.class.php b/classes/system/feature.class.php
index 93e01e7..12cfa5f 100644
--- a/classes/system/feature.class.php
+++ b/classes/system/feature.class.php
@@ -1,6 +1,6 @@
<?php
/*******************************************************************************
- * Copyright (c) 2007-2008 Eclipse Foundation and others.
+ * Copyright (c) 2007-2019 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
*
* Contributors:
* Antoine Toulme, Intalio Inc. bug 248845: Refactoring generate1.php into different files with a functional approach
+ * Denis Roy (Eclipse Foundation) - Bug 550544 - Babel server is not ready for PHP 7
*******************************************************************************/
require_once(dirname(__FILE__) . "/fragment.class.php");
@@ -45,6 +46,7 @@
* of the translation of this feature in this language.
*/
function pct_complete() {
+ global $dbh;
if (strcmp($this->language->iso, "en_AA") == 0) {
return 100;
}
@@ -279,6 +281,7 @@
}
function generateAsCSV() {
+ global $dbh;
$this->cleanupOutput(null, false);
$filename = $this->filename() . ".csv";
$language = $this->language->id;
diff --git a/classes/system/fragment.class.php b/classes/system/fragment.class.php
index 8ce93f6..91013b8 100644
--- a/classes/system/fragment.class.php
+++ b/classes/system/fragment.class.php
@@ -1,6 +1,6 @@
<?php
/*******************************************************************************
- * Copyright (c) 2007-2008 Eclipse Foundation and others.
+ * Copyright (c) 2007-2019 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
*
* Contributors:
* Antoine Toulme, Intalio Inc. bug 248845: Refactoring generate1.php into different files with a functional approach
+ * Denis Roy (Eclipse Foundation) - Bug 550544 - Babel server is not ready for PHP 7
*******************************************************************************/
require_once(dirname(__FILE__) . "/project.class.php");
@@ -40,6 +41,7 @@
/*
* Determine which plug-ins need to be in this language pack.
*/
+ global $dbh;
if (strcmp($language->iso, "en_AA") == 0) {
$sql = "SELECT DISTINCT f.project_id, f.version, f.file_id, f.name, f.plugin_id
FROM files AS f
diff --git a/classes/system/language.class.php b/classes/system/language.class.php
index e479583..9eb5cc8 100644
--- a/classes/system/language.class.php
+++ b/classes/system/language.class.php
@@ -47,6 +47,7 @@
static function all() {
$langs = array();
+ global $dbh;
$language_result = mysqli_query($dbh, "SELECT * FROM languages WHERE languages.is_active ORDER BY name, locale");
while (($language_row = mysqli_fetch_assoc($language_result)) != null) {
$langs[] = Language::fromRow($language_row);
diff --git a/classes/system/release_train.class.php b/classes/system/release_train.class.php
index a077d85..77607ee 100644
--- a/classes/system/release_train.class.php
+++ b/classes/system/release_train.class.php
@@ -30,6 +30,7 @@
static function all() {
$trains = array();
+ global $dbh;
$train_result = mysqli_query($dbh, "SELECT DISTINCT train_id FROM release_train_projects");
while (($train_row = mysqli_fetch_assoc($train_result)) != null) {
$trains[] = new ReleaseTrain($train_row['train_id']);