BUG 11461 "User not in alfabetical order in Advance Search" SOLVED
- User not in alfabetical order in Advance Search - Sorting problem in the dropdown "User", in Advanced Search, this are ordering by USERS.USR_LASTNAME field, which is incorrect - Solved problem the ordering, has taken into account the settings made in ADMIN>Settings>Environment>UserNameDisplayFormat - The ordering is in ascending - The "All Users" and "Current User" wildcards will always be the first - We have defined a new method in the "class.configuration.php" class which returns the field you should place your order to the users, this according to the settings made ..in ADMIN>Settings>Environment>UserNameDisplayFormat * Available from version ProcessMaker-2.5.1-testing.3
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
die();
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
die();
|
||||
}
|
||||
/**
|
||||
* casesList_Ajax.php
|
||||
@@ -54,19 +54,35 @@ if ($actionAjax == "userValues") {
|
||||
switch ($action) {
|
||||
case 'search_simple':
|
||||
case 'search':
|
||||
G::LoadClass("configuration");
|
||||
|
||||
$conf = new Configurations();
|
||||
|
||||
$confEnvSetting = $conf->getConfiguration("ENVIRONMENT_SETTINGS", "");
|
||||
$formatUserName = null;
|
||||
|
||||
if (is_array($confEnvSetting) && isset($confEnvSetting["format"])) {
|
||||
$formatUserName = $confEnvSetting["format"];
|
||||
}
|
||||
|
||||
$cUsers = new Criteria( 'workflow' );
|
||||
$cUsers->clearSelectColumns();
|
||||
$cUsers->addSelectColumn( UsersPeer::USR_UID );
|
||||
$cUsers->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
$cUsers->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_UID);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$cUsers->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
|
||||
$cUsers->addAscendingOrderByColumn( UsersPeer::USR_LASTNAME );
|
||||
$cUsers->addAscendingOrderByColumn(UsersPeer::TABLE_NAME . "." . $conf->userNameFormatGetFirstFieldByUsersTable());
|
||||
$oDataset = UsersPeer::doSelectRS( $cUsers );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$users[] = array ("USR_UID" => $aRow['USR_UID'],"USR_FULLNAME" => $aRow['USR_LASTNAME'] . ' ' . $aRow['USR_FIRSTNAME']);
|
||||
$oDataset->next();
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters($formatUserName, $row["USR_USERNAME"], $row["USR_FIRSTNAME"], $row["USR_LASTNAME"]);
|
||||
$usrFullName = (!empty($usrFullName))? $usrFullName : $row["USR_LASTNAME"] . " " . $row["USR_FIRSTNAME"];
|
||||
|
||||
$users[] = array("USR_UID" => $row["USR_UID"], "USR_FULLNAME" => $usrFullName);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user