Roles duplicity validation fix.

This commit is contained in:
Enrique Ponce de Leon
2011-02-25 18:04:30 +00:00
parent 7e62169902
commit 2d84a01517
2 changed files with 408 additions and 402 deletions

View File

@@ -312,9 +312,13 @@ switch ($REQUEST) {
break;
case 'checkRoleCode':
$rol_code = $_POST['ROL_CODE'];
$rol_uid = isset($_POST['ROL_UID'])? $_POST['ROL_UID']: '';
$oCriteria = new Criteria('rbac');
$oCriteria->addSelectColumn(RolesPeer::ROL_UID);
$oCriteria->add(RolesPeer::ROL_CODE, $rol_code);
if ($rol_uid !=''){
$oCriteria->add(RolesPeer::ROL_UID, $rol_uid, Criteria::NOT_EQUAL);
}
$oDataset = RolesPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($oDataset->next()){

View File

@@ -4,7 +4,8 @@
*/
//Keyboard Events
new Ext.KeyMap(document, [
new Ext.KeyMap(document,
[
{
key: Ext.EventObject.F5,
fn: function(keycode, e) {
@@ -414,13 +415,14 @@ SaveNewRole = function(){
//Update Selected Role
UpdateRole = function(){
rowSelected = infoGrid.getSelectionModel().getSelected();
rol_code = editForm.getForm().findField('code').getValue();
rol_code.trim();
if (rol_code == '') return;
viewport.getEl().mask(_('ID_PROCESSING'));
Ext.Ajax.request({
url: 'roles_Ajax',
params: {request: 'checkRoleCode', ROL_CODE: rol_code},
params: {request: 'checkRoleCode', ROL_CODE: rol_code, ROL_UID: rowSelected.data.ROL_UID},
success: function(r,o){
viewport.getEl().unmask();
resp = Ext.util.JSON.decode(r.responseText);