2 "name" : "Pman.Dialog.CoreCompanies",
5 "path" : "/home/alan/gitlive/Pman.Core/Pman.Dialog.CoreCompanies.bjs",
12 "collapsible" : false,
13 "title" : "Add / Edit Organization",
14 "xtype" : "LayoutDialog",
23 "alwaysShowTabs" : false,
25 "xtype" : "LayoutRegion",
35 "xtype" : "ContentPanel",
41 "actionfailed" : "function(f, act) {\n _this.dialog.el.unmask();\n // error msg???\n Pman.standardActionFailed(f,act);\n \n}",
42 "rendered" : "function (form)\n{\n _this.form = form;\n}",
43 "actioncomplete" : "function(f, act) {\n _this.dialog.el.unmask();\n //console.log('load completed'); \n // error messages?????\n if(act.type == 'setdata'){\n this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n return;\n }\n \n if (act.type == 'load') {\n _this.data = act.result.data;\n var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';\n \n \n if (_this.form.findField('comptype')) {\n _this.form.findField('comptype')[meth]();\n }\n \n // _this.loaded();\n return;\n }\n \n \n if (act.type == 'submit') { // only submitted here if we are \n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(this, act.result.data);\n }\n return; \n }\n // unmask?? \n}"
45 "$ url" : "baseURL + '/Roo/Companies.php'",
57 "fieldLabel" : "Company ID (for filing Ref.)",
58 "xtype" : "TextField",
67 "render" : "function (_self)\n{\n _this.etypeCombo = _self;\n}"
71 "triggerAction" : "all",
72 "fieldLabel" : "Type",
73 "forceSelection" : true,
74 "selectOnFocus" : true,
76 "emptyText" : "Select Type",
77 "displayField" : "display_name",
78 "hiddenName" : "comptype",
80 "valueField" : "name",
85 "name" : "comptype_display_name",
86 "qtip" : "Select type",
87 "queryParam" : "query[name]",
88 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> : {display_name}</div>",
89 "loadingText" : "Searching...",
93 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n //o.params['query[empty_etype]'] = 1;\n o.params.etype = 'COMPTYPE';\n}\n"
97 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
102 "$ url" : "baseURL + '/Roo/core_enum.php'",
104 "xtype" : "HttpProxy",
105 "$ xns" : "Roo.data",
111 "xtype" : "JsonReader",
112 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
113 "$ xns" : "Roo.data",
115 "totalProperty" : "total"
122 "fieldLabel" : "Company Name",
123 "xtype" : "TextField",
126 "$ xns" : "Roo.form",
128 "qtip" : "Enter Company Name"
131 "fieldLabel" : "Phone",
132 "xtype" : "TextField",
135 "$ xns" : "Roo.form",
137 "qtip" : "Enter Phone Number"
140 "fieldLabel" : "Fax",
141 "xtype" : "TextField",
144 "$ xns" : "Roo.form",
146 "qtip" : "Enter Fax Number"
149 "fieldLabel" : "Email",
150 "xtype" : "TextField",
153 "$ xns" : "Roo.form",
155 "qtip" : "Enter Email Address"
158 "fieldLabel" : "Url",
159 "xtype" : "TextField",
162 "$ xns" : "Roo.form",
167 "fieldLabel" : "Address",
168 "xtype" : "TextField",
171 "$ xns" : "Roo.form",
173 "qtip" : "Enter Address"
176 "fieldLabel" : "Remarks",
177 "xtype" : "TextArea",
180 "$ xns" : "Roo.form",
183 "qtip" : "Enter remarks"
188 "labelAlign" : "top",
191 "$ xns" : "Roo.form",
194 "fieldLabel" : "Background Colour",
195 "xtype" : "ColorField",
196 "$ xns" : "Roo.form",
197 "name" : "background_color"
200 "fieldLabel" : "Logo Image",
201 "style" : "border: 1px solid #ccc;",
202 "xtype" : "DisplayField",
203 "$ valueRenderer" : "function(v) {\n //var vp = v ? v : 'Companies:' + _this.data.id + ':-LOGO';\n if (!v) {\n return \"No Image Available\" + '<BR/>';\n }\n return String.format('<a target=\"_new\" href=\"{1}\"><img src=\"{0}\" width=\"150\"></a>', \n baseURL + '/Images/Thumb/150x150/' + v + '/logo.jpg',\n baseURL + '/Images/'+v+'/logo.jpg' // fixme - put escaped company name..\n );\n}",
204 "icon" : "rootURL + 'images/default/dd/drop-add.gif'",
206 "$ xns" : "Roo.form",
212 "click" : "function (_self, e)\n{\n var _t = _this.form.findField('logo_id');\n \n Pman.Dialog.Image.show({\n onid :_this.data.id,\n ontable : 'Companies',\n imgtype : 'LOGO'\n }, function(data) {\n if (data) {\n _t.setValue(data.id);\n }\n \n });\n}"
214 "text" : "Add Image",
222 "$ xns" : "Roo.form",
231 "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}"
236 "* prop" : "buttons[]"
240 "click" : "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
245 "* prop" : "buttons[]"