Skip to content

Commit

Permalink
Fix host and users report.
Browse files Browse the repository at this point in the history
Fix issue with hosts and users report.
Cleanup to use a more proper group by element.
  • Loading branch information
mastacontrola committed Jan 4, 2017
1 parent b410732 commit ee62611
Show file tree
Hide file tree
Showing 11 changed files with 227 additions and 180 deletions.
57 changes: 2 additions & 55 deletions packages/web/lib/fog/fogmanagercontroller.class.php
Expand Up @@ -70,13 +70,7 @@ abstract class FOGManagerController extends FOGBase
*
* @var string
*/
protected $loadQueryTemplate = 'SELECT %s FROM `%s` %s %s %s %s';
/**
* The load groupby template.
*
* @var string
*/
protected $loadQueryGroupTemplate = 'SELECT %s FROM (%s) `%s` %s %s %s %s';
protected $loadQueryTemplate = 'SELECT %s FROM `%s` %s %s %s %s %s';
/**
* The count template.
*
Expand Down Expand Up @@ -391,56 +385,9 @@ public function find(
) :
''
),
$groupBy,
$orderBy
);
if ($groupBy) {
$query = sprintf(
$this->loadQueryGroupTemplate,
(
$idField ? sprintf('`%s`', implode('`,`', $idField)) : '*'
),
$query,
$this->databaseTable,
$join,
(
count($whereArray) > 0 ?
sprintf(
' WHERE %s%s',
implode(" $whereOperator ", (array) $whereArray),
(
$isEnabled ?
sprintf(' AND %s', $isEnabled)
: ''
)
) :
(
$isEnabled ?
sprintf(
' WHERE %s',
$isEnabled
) :
''
)
),
(
count($whereArrayAnd) > 0 ?
(
count($whereArray) > 0 ?
sprintf(
'AND %s',
implode(" $whereOperator ", (array) $whereArrayAnd)
) :
sprintf(
' WHERE %s',
implode(" $whereOperator ", (array) $whereArrayAnd)
)
) :
''
),
$groupBy,
$orderBy
);
}
$data = array();
self::$DB->query($query, array(), $findVals);
if ($idField) {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/lib/fog/system.class.php
Expand Up @@ -53,7 +53,7 @@ private static function _versionCompare()
public function __construct()
{
self::_versionCompare();
define('FOG_VERSION', '1.3.1-RC-2');
define('FOG_VERSION', '6');
define('FOG_SCHEMA', 245);
define('FOG_BCACHE_VER', 111);
define('FOG_SVN_REVISION', 6052);
Expand Down
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: fog-project-2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-04 09:08-0500\n"
"POT-Creation-Date: 2017-01-04 16:10-0500\n"
"PO-Revision-Date: 2016-05-23 07:36-0400\n"
"Last-Translator: vspushbullet <vspushbullet@gmail.com>\n"
"Language-Team: German\n"
Expand Down Expand Up @@ -570,20 +570,20 @@ msgstr "Unbekannter Upload Fehler aufgetreten ist. Return-Code: "
msgid "Return code"
msgstr "Return-Code"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:620
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:567
msgid "No fields passed"
msgstr "Keine Felder übergeben"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:623
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:570
msgid "No values passed"
msgstr "Keine Werte übergeben"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:660
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:607
#, fuzzy
msgid "No data to insert"
msgstr "Keine Daten zurückgegeben"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:953
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:900
#, fuzzy
msgid "No items found"
msgstr "Keine Symbole gefunden"
Expand Down Expand Up @@ -4084,8 +4084,8 @@ msgstr "Erweiterte Optionen"
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1308
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1486
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1487
#: /var/www/fog/management/reports/hosts_and_users.report.php:17
#: /var/www/fog/management/reports/hosts_and_users.report.php:18
#: /var/www/fog/management/reports/hosts_and_users.report.php:54
#: /var/www/fog/management/reports/hosts_and_users.report.php:55
msgid "Export CSV"
msgstr "CSV exportieren"

Expand All @@ -4107,8 +4107,8 @@ msgstr "CSV exportieren"
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1491
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1727
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1728
#: /var/www/fog/management/reports/hosts_and_users.report.php:21
#: /var/www/fog/management/reports/hosts_and_users.report.php:22
#: /var/www/fog/management/reports/hosts_and_users.report.php:58
#: /var/www/fog/management/reports/hosts_and_users.report.php:59
msgid "Export PDF"
msgstr "PDF-Datei exportieren"

Expand Down Expand Up @@ -7612,7 +7612,7 @@ msgstr "Erstellen"
msgid "FOG Client"
msgstr "Nebel-Client-Wiki"

#: /var/www/fog/management/reports/hosts_and_users.report.php:13
#: /var/www/fog/management/reports/hosts_and_users.report.php:50
msgid "FOG Hosts and Users Login"
msgstr "Nebel-Hosts und Benutzer-Login"

Expand Down
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-04 09:08-0500\n"
"POT-Creation-Date: 2017-01-04 16:10-0500\n"
"PO-Revision-Date: 2016-05-22 15:14-0400\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
Expand Down Expand Up @@ -565,20 +565,20 @@ msgstr "Unknown upload error occurred. Return code: "
msgid "Return code"
msgstr "Return Code"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:620
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:567
msgid "No fields passed"
msgstr "No fields passed"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:623
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:570
msgid "No values passed"
msgstr "No values passed"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:660
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:607
#, fuzzy
msgid "No data to insert"
msgstr "No data returned"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:953
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:900
#, fuzzy
msgid "No items found"
msgstr "No icons found"
Expand Down Expand Up @@ -4072,8 +4072,8 @@ msgstr "Advanced Options"
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1308
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1486
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1487
#: /var/www/fog/management/reports/hosts_and_users.report.php:17
#: /var/www/fog/management/reports/hosts_and_users.report.php:18
#: /var/www/fog/management/reports/hosts_and_users.report.php:54
#: /var/www/fog/management/reports/hosts_and_users.report.php:55
msgid "Export CSV"
msgstr "Export CSV"

Expand All @@ -4095,8 +4095,8 @@ msgstr "Export CSV"
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1491
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1727
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1728
#: /var/www/fog/management/reports/hosts_and_users.report.php:21
#: /var/www/fog/management/reports/hosts_and_users.report.php:22
#: /var/www/fog/management/reports/hosts_and_users.report.php:58
#: /var/www/fog/management/reports/hosts_and_users.report.php:59
msgid "Export PDF"
msgstr "Export PDF"

Expand Down Expand Up @@ -7582,7 +7582,7 @@ msgstr "Create"
msgid "FOG Client"
msgstr "FOG Client Wiki"

#: /var/www/fog/management/reports/hosts_and_users.report.php:13
#: /var/www/fog/management/reports/hosts_and_users.report.php:50
msgid "FOG Hosts and Users Login"
msgstr "FOG Hosts and Users Login"

Expand Down
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-04 09:08-0500\n"
"POT-Creation-Date: 2017-01-04 16:10-0500\n"
"PO-Revision-Date: 2016-05-22 15:14-0400\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
Expand Down Expand Up @@ -568,20 +568,20 @@ msgstr "Se produjo un error de carga desconocida. Código de retorno: "
msgid "Return code"
msgstr "Código de retorno"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:620
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:567
msgid "No fields passed"
msgstr "No hay campos pasaron"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:623
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:570
msgid "No values passed"
msgstr "No hay valores pasados"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:660
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:607
#, fuzzy
msgid "No data to insert"
msgstr "No se obtuvieron datos"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:953
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:900
#, fuzzy
msgid "No items found"
msgstr "No se encontraron iconos"
Expand Down Expand Up @@ -4082,8 +4082,8 @@ msgstr "Opciones avanzadas"
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1308
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1486
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1487
#: /var/www/fog/management/reports/hosts_and_users.report.php:17
#: /var/www/fog/management/reports/hosts_and_users.report.php:18
#: /var/www/fog/management/reports/hosts_and_users.report.php:54
#: /var/www/fog/management/reports/hosts_and_users.report.php:55
msgid "Export CSV"
msgstr "Exportación CSV"

Expand All @@ -4105,8 +4105,8 @@ msgstr "Exportación CSV"
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1491
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1727
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1728
#: /var/www/fog/management/reports/hosts_and_users.report.php:21
#: /var/www/fog/management/reports/hosts_and_users.report.php:22
#: /var/www/fog/management/reports/hosts_and_users.report.php:58
#: /var/www/fog/management/reports/hosts_and_users.report.php:59
msgid "Export PDF"
msgstr "Exportar PDF"

Expand Down Expand Up @@ -7606,7 +7606,7 @@ msgstr "Crear"
msgid "FOG Client"
msgstr "FOG Wiki Cliente"

#: /var/www/fog/management/reports/hosts_and_users.report.php:13
#: /var/www/fog/management/reports/hosts_and_users.report.php:50
msgid "FOG Hosts and Users Login"
msgstr "Los anfitriones niebla y Acceso a usuarios"

Expand Down
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-04 09:08-0500\n"
"POT-Creation-Date: 2017-01-04 16:10-0500\n"
"PO-Revision-Date: 2016-05-22 15:14-0400\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
Expand Down Expand Up @@ -570,20 +570,20 @@ msgstr "Erreur inconnue de téléchargement a eu lieu. Code de retour: "
msgid "Return code"
msgstr "code de retour"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:620
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:567
msgid "No fields passed"
msgstr "Aucun champ passé"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:623
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:570
msgid "No values passed"
msgstr "Aucune valeur passées"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:660
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:607
#, fuzzy
msgid "No data to insert"
msgstr "Aucune donnée retournés"

#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:953
#: /var/www/fog/lib/fog/fogmanagercontroller.class.php:900
#, fuzzy
msgid "No items found"
msgstr "Pas d'icônes trouvées"
Expand Down Expand Up @@ -4088,8 +4088,8 @@ msgstr "Options avancées"
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1308
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1486
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1487
#: /var/www/fog/management/reports/hosts_and_users.report.php:17
#: /var/www/fog/management/reports/hosts_and_users.report.php:18
#: /var/www/fog/management/reports/hosts_and_users.report.php:54
#: /var/www/fog/management/reports/hosts_and_users.report.php:55
msgid "Export CSV"
msgstr "Export CSV"

Expand All @@ -4111,8 +4111,8 @@ msgstr "Export CSV"
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1491
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1727
#: /var/www/fog/lib/pages/reportmanagementpage.class.php:1728
#: /var/www/fog/management/reports/hosts_and_users.report.php:21
#: /var/www/fog/management/reports/hosts_and_users.report.php:22
#: /var/www/fog/management/reports/hosts_and_users.report.php:58
#: /var/www/fog/management/reports/hosts_and_users.report.php:59
msgid "Export PDF"
msgstr "Export PDF"

Expand Down Expand Up @@ -7614,7 +7614,7 @@ msgstr "Créer"
msgid "FOG Client"
msgstr "FOG client Wiki"

#: /var/www/fog/management/reports/hosts_and_users.report.php:13
#: /var/www/fog/management/reports/hosts_and_users.report.php:50
msgid "FOG Hosts and Users Login"
msgstr "Hôtes BROUILLARD et utilisateurs Connexion"

Expand Down

0 comments on commit ee62611

Please sign in to comment.