_strings : {
'ea4788705e6873b424c65e91c2846b19' :"Cancel",
- 'a0f852ef8bfccd86a0e7217d7959e3e8' :"Add / Edit User",
+ '106eefbc3cdf294434c52c2638ce28df' :"Add / Edit Group",
'49ee3087348e8d44e1feda1917443987' :"Name",
'c9cc8cce247e49bae79f15173ce97354' :"Save"
},
+ _named_strings : {
+ 'display_name_placeholder' : '49ee3087348e8d44e1feda1917443987' /* Name */
+ },
dialog : false,
callback: false,
var _this = this;
this.dialog = Roo.factory({
xtype : 'Modal',
- title : _this._strings['a0f852ef8bfccd86a0e7217d7959e3e8'] /* Add / Edit User */,
- listeners : {
- render : function (_self)
- {
- _this.modal = _self;
- }
- },
+ cls : 'enable-overflow padding-bottom-trim',
+ title : _this._strings['106eefbc3cdf294434c52c2638ce28df'] /* Add / Edit Group */,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
buttons : [
return;
}
- var myID = _this.form.findField('id').getValue() * 1;
- var myName = _this.form.findField('name').getValue();
-
- if (_this.form.findField('company_id') && !_this.form.findField('company_id').getValue()) {
- Roo.bootstrap.MessageBox.alert("Error", "Select a Company");
- return;
- }
-
- // validate password match (only needed if we are not using generated one..
- if (_this.form.findField('passwd1')
- && _this.form.findField('passwd1').getValue().length > 0
- && _this.form.findField('passwd1').inputEl().dom.type == "password") {
-
- var p1 = _this.form.findField('passwd1').getValue();
- var p2 = _this.form.findField('passwd2').getValue();
-
-
- if (Pman.Login.authUser.id < 0 && !p1.length) {
- Roo.bootstrap.MessageBox.alert("Error", "You must create a password for the admin account");
- return;
- }
-
-
- if (p1.length || p2.length) {
- if (p1 != p2) {
- Roo.bootstrap.MessageBox.alert("Error", "Passwords do not match");
- return;
- }
- }
-
-
- }
_this.form.doAction("submit");
-
-
-
+
return;
}
},
actioncomplete : function (_self, action)
{
if(action.type == 'setdata'){
-
+ _this.dialog.setTitle("Create Group");
if(_this.data.id * 1 > 0) {
this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
+ _this.dialog.setTitle("Edit Group");
}
return;
if (action.type == 'load') {
_this.data = action.result.data;
+
+ if(!_this.data.display_name.length){
+ _this.form.findField('display_name').setValue(_this.data.name);
+ }
return;
}
actionfailed : function (_self, action)
{
Roo.log(action);
- Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
+ Roo.bootstrap.MessageBox.alert('Error', action.result.errorMsg);
},
render : function (_self)
{
items : [
{
xtype : 'Input',
- name : 'name',
+ name : 'display_name',
placeholder : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap'