Merge branch 'master' of git@github.com:colosa/processmaker.git

This commit is contained in:
marcelo
2013-03-22 09:50:50 -04:00
8 changed files with 79 additions and 41 deletions

View File

@@ -197,7 +197,7 @@ class RbacUsers extends BaseRbacUsers
$pluginRegistry = & PMPluginRegistry::getSingleton();
if ($pluginRegistry->existsTrigger(PM_BEFORE_CREATE_USER)) {
try {
$pluginRegistry->executeTriggers(PM_BEFORE_CREATE_USER);
$pluginRegistry->executeTriggers(PM_BEFORE_CREATE_USER, null);
} catch(Exception $error) {
throw new Exception($error->getMessage());
}

View File

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

View File

@@ -394,12 +394,44 @@ class Applications
$totalCount = AppCacheViewPeer::doCount($CriteriaCount, $distinct);
}
//add sortable options
if ($sort != '') {
if ($dir == 'DESC') {
$Criteria->addDescendingOrderByColumn( $sort );
//Add sortable options
if ($sort != "") {
//Current delegation (*)
if (($action == "sent" || $action == "search" || $action == "simple_search" || $action == "to_revise" || $action == "to_reassign") && ($status != "TO_DO")) {
switch ($sort) {
case "APP_CACHE_VIEW.APP_CURRENT_USER":
$sort = "USRCR_USR_LASTNAME";
$confEnvSetting = $conf->getConfiguration("ENVIRONMENT_SETTINGS", "");
if (is_array($confEnvSetting)) {
$arrayAux = explode(" ", str_replace(array("(", ")", ","), array(null, null, null), $confEnvSetting["format"]));
if (isset($arrayAux[0])) {
switch (trim($arrayAux[0])) {
case "@userName":
$sort = "USRCR_USR_USERNAME";
break;
case "@firstName":
$sort = "USRCR_USR_FIRSTNAME";
break;
case "@lastName":
$sort = "USRCR_USR_LASTNAME";
break;
}
}
}
break;
case "APP_CACHE_VIEW.APP_TAS_TITLE":
$sort = "APPCVCR_APP_TAS_TITLE";
break;
}
}
if ($dir == "DESC") {
$Criteria->addDescendingOrderByColumn($sort);
} else {
$Criteria->addAscendingOrderByColumn( $sort );
$Criteria->addAscendingOrderByColumn($sort);
}
}
@@ -444,7 +476,7 @@ class Applications
$maxDataset->close();
}*/
//Current delegation
//Current delegation (*)
if (($action == "sent" || $action == "search" || $action == "simple_search" || $action == "to_revise" || $action == "to_reassign") && ($status != "TO_DO")) {
//Current task
$aRow["APP_TAS_TITLE"] = $aRow["APPCVCR_APP_TAS_TITLE"];

View File

@@ -591,7 +591,7 @@ class ReportTables
if (! isset( $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;
case 'date':
$mysqlDate = (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']] : '');
@@ -646,32 +646,34 @@ class ReportTables
$aAux = explode( '-', $aRow['REP_TAB_GRID'] );
if (isset( $aFields[$aAux[0]] )) {
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
$sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`';
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;
if (is_array($aFields[$aAux[0]])) {
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
$sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`';
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 .= ')';
$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_CITY_NAME"] = (!empty($aIsoSubdivision["IS_NAME"]))? $aIsoSubdivision["IS_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;

View File

@@ -97,7 +97,7 @@ switch ($_POST['action']) {
$roles = new Roles();
$rolesData = $roles->getAllRoles();
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));
break;
@@ -613,4 +613,3 @@ switch ($_POST['action']) {
echo G::json_encode($response);
break;
}

View File

@@ -166,7 +166,7 @@ Export.submit = function()
if (result.success) {
location.href = result.link;
} else {
PMExt.error(_('ID_ERROR'), result.message));
PMExt.error(_('ID_ERROR'), result.message);
}
},
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_DUE_DATE2").setText(data.user.USR_DUE_DATE);
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_CASES_MENUSELECTED2").setText(data.user.CASES_MENUSELECTED_NAME);