Merge remote branch 'upstream/master' into BUG-10834

This commit is contained in:
Hector Cortez
2013-03-21 16:11:48 -04:00
6 changed files with 40 additions and 34 deletions

View File

@@ -84,6 +84,11 @@ class Roles extends BaseRoles {
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next(); $oDataset->next();
$aRow = $oDataset->getRow(); $aRow = $oDataset->getRow();
$roles = new Roles();
$roles->load($aRow['ROL_UID']);
$aRow['ROL_NAME'] = $roles->getRolName();
if (is_array($aRow)) { if (is_array($aRow)) {
return $aRow; return $aRow;
} else { } else {
@@ -168,10 +173,6 @@ class Roles extends BaseRoles {
return $result; return $result;
} }
function getAllRoles($systemCode = 'PROCESSMAKER') { function getAllRoles($systemCode = 'PROCESSMAKER') {
$c = $this->listAllRoles($systemCode); $c = $this->listAllRoles($systemCode);
$rs = RolesPeer::DoSelectRs($c); $rs = RolesPeer::DoSelectRs($c);
@@ -188,7 +189,6 @@ class Roles extends BaseRoles {
return $aRows; return $aRows;
} }
function listAllPermissions($systemCode = 'PROCESSMAKER') { function listAllPermissions($systemCode = 'PROCESSMAKER') {
try { try {
$oCriteria = new Criteria('rbac'); $oCriteria = new Criteria('rbac');

View File

@@ -591,7 +591,7 @@ class ReportTables
if (! isset( $aFields[$aField['sFieldName']] )) { if (! isset( $aFields[$aField['sFieldName']] )) {
$aFields[$aField['sFieldName']] = ''; $aFields[$aField['sFieldName']] = '';
} }
$sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? mysql_real_escape_string( $aFields[$aField['sFieldName']] ) : '') . "',"; $sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? @mysql_real_escape_string( $aFields[$aField['sFieldName']] ) : '') . "',";
break; break;
case 'date': case 'date':
$mysqlDate = (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']] : ''); $mysqlDate = (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']] : '');
@@ -646,32 +646,34 @@ class ReportTables
$aAux = explode( '-', $aRow['REP_TAB_GRID'] ); $aAux = explode( '-', $aRow['REP_TAB_GRID'] );
if (isset( $aFields[$aAux[0]] )) { if (isset( $aFields[$aAux[0]] )) {
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) { if (is_array($aFields[$aAux[0]])) {
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` ('; foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
$sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`'; $sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
foreach ($aTableFields as $aField) { $sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`';
$sQuery .= ',`' . $aField['sFieldName'] . '`'; foreach ($aTableFields as $aField) {
} $sQuery .= ',`' . $aField['sFieldName'] . '`';
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int) $iApplicationNumber . ',' . $iRow;
foreach ($aTableFields as $aField) {
switch ($aField['sType']) {
case 'number':
$sQuery .= ',' . (isset( $aGridRow[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aGridRow[$aField['sFieldName']] ) : '0');
break;
case 'char':
case 'text':
if (! isset( $aGridRow[$aField['sFieldName']] )) {
$aGridRow[$aField['sFieldName']] = '';
}
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? mysql_real_escape_string( $aGridRow[$aField['sFieldName']] ) : '') . "'";
break;
case 'date':
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? $aGridRow[$aField['sFieldName']] : '') . "'";
break;
} }
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int) $iApplicationNumber . ',' . $iRow;
foreach ($aTableFields as $aField) {
switch ($aField['sType']) {
case 'number':
$sQuery .= ',' . (isset( $aGridRow[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aGridRow[$aField['sFieldName']] ) : '0');
break;
case 'char':
case 'text':
if (! isset( $aGridRow[$aField['sFieldName']] )) {
$aGridRow[$aField['sFieldName']] = '';
}
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? mysql_real_escape_string( $aGridRow[$aField['sFieldName']] ) : '') . "'";
break;
case 'date':
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? $aGridRow[$aField['sFieldName']] : '') . "'";
break;
}
}
$sQuery .= ')';
$rs = $stmt->executeQuery( $sQuery );
} }
$sQuery .= ')';
$rs = $stmt->executeQuery( $sQuery );
} }
} }
} }

View File

@@ -141,6 +141,11 @@ class Users extends BaseUsers
$aFields["USR_COUNTRY_NAME"] = (!empty($aIsoCountry["IC_NAME"]))? $aIsoCountry["IC_NAME"] : ""; $aFields["USR_COUNTRY_NAME"] = (!empty($aIsoCountry["IC_NAME"]))? $aIsoCountry["IC_NAME"] : "";
$aFields["USR_CITY_NAME"] = (!empty($aIsoSubdivision["IS_NAME"]))? $aIsoSubdivision["IS_NAME"] : ""; $aFields["USR_CITY_NAME"] = (!empty($aIsoSubdivision["IS_NAME"]))? $aIsoSubdivision["IS_NAME"] : "";
$aFields["USR_LOCATION_NAME"] = (!empty($aIsoLocation["IL_NAME"]))? $aIsoLocation["IL_NAME"] : ""; $aFields["USR_LOCATION_NAME"] = (!empty($aIsoLocation["IL_NAME"]))? $aIsoLocation["IL_NAME"] : "";
require_once PATH_RBAC . "model/Roles.php";
$roles = new Roles();
$role = $roles->loadByCode($aFields['USR_ROLE']);
$aFields['USR_ROLE_NAME'] = $role['ROL_NAME'];
$result = $aFields; $result = $aFields;

View File

@@ -97,7 +97,7 @@ switch ($_POST['action']) {
$roles = new Roles(); $roles = new Roles();
$rolesData = $roles->getAllRoles(); $rolesData = $roles->getAllRoles();
foreach ($rolesData as $rowid => $row) { foreach ($rolesData as $rowid => $row) {
$oData[] = array('ROL_UID' => $row['ROL_CODE'], 'ROL_CODE' => $row['ROL_CODE']); $oData[] = array('ROL_UID' => $row['ROL_CODE'], 'ROL_CODE' => $row['ROL_NAME']);
} }
print (G::json_encode($oData)); print (G::json_encode($oData));
break; break;
@@ -613,4 +613,3 @@ switch ($_POST['action']) {
echo G::json_encode($response); echo G::json_encode($response);
break; break;
} }

View File

@@ -166,7 +166,7 @@ Export.submit = function()
if (result.success) { if (result.success) {
location.href = result.link; location.href = result.link;
} else { } else {
PMExt.error(_('ID_ERROR'), result.message)); PMExt.error(_('ID_ERROR'), result.message);
} }
}, },
failure: function(obj, resp){ failure: function(obj, resp){

View File

@@ -1196,7 +1196,7 @@ function loadUserData()
Ext.getCmp("USR_REPLACED_BY2").setText(data.user.REPLACED_NAME); Ext.getCmp("USR_REPLACED_BY2").setText(data.user.REPLACED_NAME);
Ext.getCmp("USR_DUE_DATE2").setText(data.user.USR_DUE_DATE); Ext.getCmp("USR_DUE_DATE2").setText(data.user.USR_DUE_DATE);
Ext.getCmp("USR_STATUS2").setText(_('ID_' + data.user.USR_STATUS)); Ext.getCmp("USR_STATUS2").setText(_('ID_' + data.user.USR_STATUS));
Ext.getCmp("USR_ROLE2").setText(data.user.USR_ROLE); Ext.getCmp("USR_ROLE2").setText(data.user.USR_ROLE_NAME);
Ext.getCmp("PREF_DEFAULT_MAIN_MENU_OPTION2").setText(data.user.MENUSELECTED_NAME); Ext.getCmp("PREF_DEFAULT_MAIN_MENU_OPTION2").setText(data.user.MENUSELECTED_NAME);
Ext.getCmp("PREF_DEFAULT_CASES_MENUSELECTED2").setText(data.user.CASES_MENUSELECTED_NAME); Ext.getCmp("PREF_DEFAULT_CASES_MENUSELECTED2").setText(data.user.CASES_MENUSELECTED_NAME);