Merge pull request #92 from alvarocs/BUG-0000

Bug 0000 enable/disable for the buttons
This commit is contained in:
julceslauhub
2012-06-21 07:07:17 -07:00
6 changed files with 24 additions and 10 deletions

View File

@@ -1021,12 +1021,13 @@ class System {
if (defined('PATH_DB')) { // if we're on a valid workspace env.
if (empty($wsName)) {
$uriParts = explode('/', getenv("REQUEST_URI"));
if (substr($uriParts[1], 0, 3 ) == 'sys') {
$wsName = substr($uriParts[1], 3);
if (isset($uriParts[1])) {
if (substr($uriParts[1], 0, 3 ) == 'sys') {
$wsName = substr($uriParts[1], 3);
}
}
}
$wsIniFile = PATH_DB . $wsName . PATH_SEP . 'env.ini';
}
}

View File

@@ -556,7 +556,7 @@ switch($_POST['action'])
} else {
$color = 'green';
$img = '/images/dialog-ok-apply.png';
$aFields['DESCRIPTION'] .= G::LoadTranslation('ID_PASSWORD_COMPLIES_POLICIES') . '</span>';
$aFields['DESCRIPTION'] = G::LoadTranslation('ID_PASSWORD_COMPLIES_POLICIES') . '</span>';
$aFields['STATUS'] = true;
}
$span = '<span style="color: ' . $color . '; font: 9px tahoma,arial,helvetica,sans-serif;">';

View File

@@ -14,6 +14,7 @@ if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
$oHeadPublisher->assign('USR_UID', $_GET['USR_UID']);
$oHeadPublisher->assign('USR_UID', $_GET['USR_UID']);
$oHeadPublisher->assign('MODE', $_GET['MODE']);
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
G::RenderPage('publish', 'extJs');

View File

@@ -16,5 +16,6 @@ if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
$oHeadPublisher->assign('USR_UID', '');
$oHeadPublisher->assign('MODE', $_GET['MODE']);
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
G::RenderPage('publish', 'extJs');

View File

@@ -32,7 +32,10 @@ Ext.onReady(function() {
}
});
if (MODE == 'edit')
flagPoliciesPassword = true;
//EDIT MODE
if (USR_UID != '') {
allowBlackStatus = true;
@@ -454,6 +457,8 @@ Ext.onReady(function() {
listeners: {
blur : function(ob)
{
Ext.getCmp('saveB').disable();
Ext.getCmp('cancelB').disable();
var spanAjax = '<span style="font: 9px tahoma,arial,helvetica,sans-serif;">';
var imageAjax = '<img width="13" height="13" border="0" src="/images/ajax-loader.gif">';
var labelAjax = _('ID_PASSWORD_TESTING');
@@ -479,7 +484,9 @@ Ext.onReady(function() {
flagPoliciesPassword = false;
}
Ext.getCmp('passwordReview').setText(resp.DESCRIPTION, false);
Ext.getCmp('passwordReview').setText(resp.DESCRIPTION, false);
Ext.getCmp('saveB').enable();
Ext.getCmp('cancelB').enable();
},
failure: function () {
Ext.MessageBox.show({
@@ -489,6 +496,8 @@ Ext.onReady(function() {
animEl: 'mb9',
icon: Ext.MessageBox.ERROR
});
Ext.getCmp('saveB').enable();
Ext.getCmp('cancelB').enable();
}
});
@@ -648,12 +657,14 @@ Ext.onReady(function() {
buttons : [
{
text : _('ID_SAVE'),
id : 'saveB',
handler: saveUser
},
{
text : _('ID_CANCEL'),
id : 'cancelB',
handler : function(){
if (!infoMode) {
location.href = 'users_List';

View File

@@ -403,7 +403,7 @@ DoNothing = function(){};
//Open New User Form
NewUserAction = function(){
location.href = 'usersNew';
location.href = 'usersNew?MODE=new';
};
//Delete User Action
@@ -469,7 +469,7 @@ SummaryTabOpen = function(){
EditUserAction = function(){
var uid = infoGrid.getSelectionModel().getSelected();
if (uid) {
location.href = 'usersEdit?USR_UID=' + uid.data.USR_UID+'&USR_AUTH_SOURCE=' + uid.data.USR_AUTH_SOURCE;
location.href = 'usersEdit?USR_UID=' + uid.data.USR_UID+'&USR_AUTH_SOURCE=' + uid.data.USR_AUTH_SOURCE+'&MODE=edit';
}
};