Correccion de errores stdclass

This commit is contained in:
Brayan Osmar Pereyra Suxo
2014-07-03 09:45:15 -04:00
parent b5be3f5ec4
commit 3335e99e9d
5 changed files with 23 additions and 21 deletions

View File

@@ -188,6 +188,7 @@ class TaskUser extends BaseTaskUser
while ($dataset->next()) { while ($dataset->next()) {
$usersTask[] = $dataset->getRow(); $usersTask[] = $dataset->getRow();
} }
$result = new stdClass();
$result->data = $usersTask; $result->data = $usersTask;
$result->totalCount = sizeof( $usersTask ); $result->totalCount = sizeof( $usersTask );

View File

@@ -363,6 +363,7 @@ class Users extends BaseUsers
$rows[] = $rs->getRow(); $rows[] = $rs->getRow();
} }
$result = new stdClass();
$result->data = $rows; $result->data = $rows;
$result->totalCount = $totalCount; $result->totalCount = $totalCount;

View File

@@ -23,16 +23,14 @@
* *
*/ */
if (defined('PATH_DB') && defined('SYS_SYS')) { if (defined('PATH_DB') && defined('SYS_SYS')) {
if (!file_exists(PATH_DB . SYS_SYS . '/db.php')) if (!file_exists(PATH_DB . SYS_SYS . '/db.php'))
throw new Exception("Could not find db.php in current workspace " . SYS_SYS); throw new Exception("Could not find db.php in current workspace " . SYS_SYS);
require_once(PATH_DB . SYS_SYS . '/db.php'); require_once(PATH_DB . SYS_SYS . '/db.php');
//to do: enable for other databases //to do: enable for other databases
$dbType = DB_ADAPTER; $dbType = DB_ADAPTER;
$dsn = DB_ADAPTER . '://' . DB_USER . ':' . DB_PASS . '@' . DB_HOST . '/' . DB_NAME; $dsn = DB_ADAPTER . '://' . DB_USER . ':' . DB_PASS . '@' . DB_HOST . '/' . DB_NAME;
//to do: enable a mechanism to select RBAC Database //to do: enable a mechanism to select RBAC Database
@@ -42,18 +40,19 @@
$dsnReport = DB_ADAPTER . '://' . DB_REPORT_USER . ':' . DB_REPORT_PASS . '@' . DB_REPORT_HOST . '/' . DB_REPORT_NAME; $dsnReport = DB_ADAPTER . '://' . DB_REPORT_USER . ':' . DB_REPORT_PASS . '@' . DB_REPORT_HOST . '/' . DB_REPORT_NAME;
switch (DB_ADAPTER) { switch (DB_ADAPTER) {
case 'mysql': case 'mysql':
$dsn .= '?encoding=utf8'; $dsn .= '?encoding=utf8';
$dsnRbac .= '?encoding=utf8'; $dsnRbac .= '?encoding=utf8';
$dsnReport .= '?encoding=utf8'; $dsnReport .= '?encoding=utf8';
break; break;
case 'mssql': case 'mssql':
//$dsn .= '?sendStringAsUnicode=false'; case 'sqlsrv':
//$dsnRbac .= '?sendStringAsUnicode=false'; //$dsn .= '?sendStringAsUnicode=false';
//$dsnReport .= '?sendStringAsUnicode=false'; //$dsnRbac .= '?sendStringAsUnicode=false';
break; //$dsnReport .= '?sendStringAsUnicode=false';
default: break;
break; default:
break;
} }
$pro ['datasources']['workflow']['connection'] = $dsn; $pro ['datasources']['workflow']['connection'] = $dsn;
@@ -65,9 +64,9 @@
$pro ['datasources']['rp']['connection'] = $dsnReport; $pro ['datasources']['rp']['connection'] = $dsnReport;
$pro ['datasources']['rp']['adapter'] = DB_ADAPTER; $pro ['datasources']['rp']['adapter'] = DB_ADAPTER;
} }
$pro ['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os'; $pro ['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';
$pro ['datasources']['dbarray']['adapter'] = 'dbarray'; $pro ['datasources']['dbarray']['adapter'] = 'dbarray';
return $pro; return $pro;

View File

@@ -145,6 +145,7 @@ class Dashboard extends Controller
$oConfiguration->aConfig = $dataDashboard; $oConfiguration->aConfig = $dataDashboard;
$oConfiguration->saveConfig('Dashboard', '', '', $_SESSION['USER_LOGGED']); $oConfiguration->saveConfig('Dashboard', '', '', $_SESSION['USER_LOGGED']);
$result = new stdClass();
$result->success = '1'; $result->success = '1';
return $result; return $result;
} catch (Exception $error) { } catch (Exception $error) {

View File

@@ -48,7 +48,7 @@ try {
} else { } else {
$sfunction = $_POST['functions']; $sfunction = $_POST['functions'];
} }
$result = new stdclass();
switch ($sfunction) { switch ($sfunction) {
case 'getRelationInfDoc': case 'getRelationInfDoc':
try { try {