+ },
+ c_name : function() {
+ return {
+
+ name : 'name',
+ fieldLabel : "Company Name",
+ value : '',
+ allowBlank : true,
+ qtip : "Enter Company Name",
+ xtype : 'TextField',
+ width : 300
+ }
+ },
+ c_tel : function() {
+ return {
+
+ name : 'tel',
+ fieldLabel : "Phone",
+ value : '',
+ allowBlank : true,
+ qtip : "Enter Phone Number",
+ xtype : 'TextField',
+ width : 300
+ }
+ },
+ c_fax : function() {
+ return {
+
+ name : 'fax',
+ fieldLabel : "fax",
+ value : '',
+ allowBlank : true,
+ qtip : "Enter fax Number",
+ xtype : 'TextField',
+ width : 300
+ }
+ },
+ c_email : function() {
+ return {
+
+ name : 'email',
+ fieldLabel : "Email",
+ value : '',
+ allowBlank : true,
+ qtip : "Enter Email Address",
+ xtype : 'TextField',
+ width : 300
+ }
+ },
+ c_address : function() {
+ return {
+
+ name : 'address',
+ fieldLabel : "Address",
+ value : '',
+ allowBlank : true,
+ qtip : "Enter Address",
+ xtype : 'TextArea',
+ height : 70,
+ width : 300
+ }
+ },
+ c_remarks : function() {
+ return {
+
+ name : 'remarks',
+ fieldLabel : "Remarks",
+ value : '',
+ allowBlank : true,
+ qtip : "Enter remarks",
+ xtype : 'TextArea',
+ height : 40,
+ width : 300
+ }
+ },
+ c_background_color : function() {
+ return {
+ xtype: 'ColorField',
+ name : 'background_color',
+ fieldLabel: "Background Colour"
+ }
+ },
+ c_image_view : function() {
+ var _this = this;
+ return {
+ xtype : 'FieldSetEx',
+ name : 'image-view',
+ collapseGroup : 'companies-image',
+ value: 0,
+ labelWidth: 100,
+ expanded: true,
+ style: 'width:420px;',
+ legend : "Logo Image",
+ items: [
+ {
+ xtype : 'DisplayImage', // image preview...
+ name : 'logo_id',
+ fieldLabel : 'Logo Image',
+ width: 300,
+ height: 50,
+ renderer : function(v) {
+ return v ? String.format('<img src="{0}" height="{1}">',
+ baseURL + '/Images/' + v + '/' + _this.data.logo_id_filename,
+ Math.min(this.height, _this.data.logo_id_height)) : "No Image Attached";
+
+ }
+ }
+ ]
+
+ }
+ },
+ c_image_edit : function() {
+ var _this = this;
+ return {
+ name : 'logo_id',
+ fieldLabel : "Logo Image",
+ value : '',
+ allowBlank : true,
+ style: 'border: 1px solid #ccc;',
+ xtype : 'DisplayImage',
+ width : 170,
+ height: 170,
+ addTitle : "Change / Add Image",
+ icon: Roo.rootURL + 'images/default/dd/drop-add.gif',
+ handler : function() {
+ var _t = this;
+
+ Pman.Dialog.Image.show({
+ onid :_this.data.id,
+ ontable : 'Companies',
+ imgtype : 'LOGO'
+ }, function(data) {
+ if (data) {
+ _t.setValue(data.id);
+ }
+
+ });
+ },
+ renderer : 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'
+ );
+ }
+
+ } ;
+
+ },
+ c_image_change: function() {
+ return {
+ xtype : 'FieldSetEx',
+ collapseGroup : 'companies-image',
+ name : 'image-change',
+ value: 0,
+ labelWidth: 100,
+ expanded: false,
+ style: 'width:420px;',
+ legend : "Add / Change Image",
+ items : [
+ {
+ xtype : 'TextField',
+ name : 'imageUpload',
+ fieldLabel : "Upload Image",
+ inputType : 'file'
+ }
+ ]
+ }
+ },
+ c_isOwner : function() {
+ return {
+ name : 'isOwner',
+ value : '',
+ xtype : 'Hidden'
+ }
+ },
+ c_id : function() {
+ return {
+ name : 'id',
+ value : '',
+ xtype : 'Hidden'
+ }
+ }