BUG 6477 Fix bug, fields in the User Summary.
This commit is contained in:
@@ -25,7 +25,9 @@
|
||||
*/
|
||||
|
||||
require_once 'classes/model/om/BaseUsers.php';
|
||||
|
||||
require_once 'classes/model/IsoCountry.php';
|
||||
require_once 'classes/model/IsoSubdivision.php';
|
||||
require_once 'classes/model/IsoLocation.php';
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'USERS' table.
|
||||
@@ -132,6 +134,39 @@ public function userExists($UsrUid)
|
||||
}
|
||||
}
|
||||
|
||||
public function loadDetailed($UsrUid)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$oUser = UsersPeer::retrieveByPK( $UsrUid );
|
||||
if (!is_null($oUser)) {
|
||||
|
||||
$aFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
|
||||
$this->setNew(false);
|
||||
|
||||
$aIsoCountry = IsoCountry::findById($aFields['USR_COUNTRY']);
|
||||
$aIsoSubdivision = IsoSubdivision::findById($aFields['USR_COUNTRY'], $aFields['USR_CITY']);
|
||||
$aIsoLocation = IsoLocation::findById($aFields['USR_COUNTRY'], $aFields['USR_CITY'], $aFields['USR_LOCATION']);
|
||||
|
||||
$aFields['USR_COUNTRY_NAME'] = $aIsoCountry['IC_NAME'];
|
||||
$aFields['USR_CITY_NAME'] = $aIsoSubdivision['IS_NAME'];
|
||||
$aFields['USR_LOCATION_NAME'] = $aIsoLocation['IL_NAME'];
|
||||
|
||||
$result = $aFields;
|
||||
|
||||
return $result;
|
||||
}
|
||||
else {
|
||||
// return $result;
|
||||
throw(new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
|
||||
public function update($fields)
|
||||
{
|
||||
$con = Propel::getConnection(UsersPeer::DATABASE_NAME);
|
||||
|
||||
Reference in New Issue
Block a user