this.dialog = Roo.factory({
xtype: 'LayoutDialog',
xns: Roo,
+ listeners : {
+ beforeshow : function (_self)
+ {
+ if (data.isOwner || !Pman.Login.isOwner()) {
+ this.dialog.setTitle("Your Company Details");
+ if (this.form.findField('comptype')) {
+ this.form.findField('comptype').disable();
+ }
+
+
+
+
+ } else {
+ this.dialog.setTitle(data.id ? "Edit Company" : "Add Company");
+ if (this.form.findField('comptype')) {
+ this.form.findField('comptype').enable();
+ }
+ }
+ }
+ },
autoCreate : 'true',
closable : false,
collapsible : false,
name : 'background_color'
},
{
- xtype: 'FieldSet',
+ xtype: 'DisplayField',
xns: Roo.form,
- items : [
+ fieldLabel : 'Logo Image',
+ height : 170,
+ icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
+ name : 'logo_id',
+ style : 'border: 1px solid #ccc;',
+ width : 170,
+ valueRenderer : function(v) {
+ //var vp = v ? v : 'Companies:' + _this.data.id + ':-LOGO';
+ if (!v) {
+ return "No Image Available" + '<BR/>';
+ }
+ return String.format('<img src="{0}" width="150">',
+ baseURL + '/Images/Thumb/150x150/' + v + '/logo.jpg'
+ );
+ }
+ },
+ {
+ xtype: 'Button',
+ xns: Roo,
+ listeners : {
+ click : function (_self, e)
{
- xtype: 'DisplayField',
- xns: Roo.form,
- icon : 'rootURL + \'images/default/dd/drop-add.gif\''
+ var _t = _this.form.findField('logo_id');
+
+ Pman.Dialog.Image.show({
+ onid :_this.data.id,
+ ontable : 'Companies',
+ imgtype : 'LOGO'
+ }, function(data) {
+ if (data) {
+ _t.setValue(data.id);
+ }
+
+ });
}
- ]
+ },
+ text : "Add Image"
}
]
+ },
+ {
+ xtype: 'Hidden',
+ xns: Roo.form,
+ name : 'isOwner'
+ },
+ {
+ xtype: 'Hidden',
+ xns: Roo.form,
+ name : 'id'
}
]
}