1 //<script type="text/javascript">
5 * All Our standard form fields
7 * should move this really..
12 project_id : function (cfg) {
14 cfg.storeListeners = cfg.storeListeners || {};
18 fieldLabel: "Project",
19 name : 'project_id_code',
20 hiddenName: 'project_id',
24 qtip : "Select Project",
35 url: baseURL + '/Roo/Projects.html',
38 reader: new Roo.data.JsonReader({}, []), //Pman.Readers.Projects,
39 listeners : Roo.apply(
41 loadexception : Pman.loadException
47 field: 'code', direction: 'ASC'
57 tpl: new Ext.Template(
58 '<div class="x-grid-cell-text x-btn button">',
59 '<b>{code}</b> {name}',
62 queryParam: 'query[project_search]',
63 loadingText: "Searching...",
73 company_id : function(cfg) { // really picks names...
75 cfg.storeListeners = cfg.storeListeners || {};
76 // we may want to set up cfg listners default here???
77 cfg.listeners = cfg.listeners || {};
80 // things we might want to change...
82 name : 'addressto_name',
85 fieldLabel : "Sent To",
86 qtip : "Enter Sent To",
91 xtype: 'ComboBoxAdder',
101 url: baseURL + '/Roo/core_company',
104 reader: Pman.Readers.Companies,
106 listeners : Roo.apply(
108 loadexception : Pman.loadException
114 field: 'name', direction: 'ASC'
120 forceSelection: true,
122 triggerAction: 'all',
123 tpl: new Ext.Template(
124 '<div class="x-grid-cell-text x-btn button">',
125 '<b>{name}</b> {address}',
128 queryParam: 'query[name]',
129 loadingText: "Searching...",
138 doctype_name: function(cfg) {
141 // things that might need chnaging
142 name : 'doctype_name',
148 qtip : "Select Document Type",
158 url: baseURL + '/Roo/Document_Types.html',
162 reader: Pman.Readers.Document_Types,
164 beforeload: function(t, o) {
165 //console.log(o.params);
166 o.params.limit = 9999;
168 loadexception : Pman.loadException
173 field: 'name', direction: 'ASC'
181 triggerAction: 'all',
182 //emptyText:'Select a state...',
188 address_list_adder : function(cfg) {
190 cfg.storeListeners = cfg.storeListeners || {};
197 renderer : function(d) {
198 return String.format('{0}',
199 d.name.length ? d.name : d.email
204 xtype: 'ComboBoxLister',
208 qtip : "Select an address to add.",
219 url: baseURL + '/Roo/core_person',
222 reader: Pman.Readers.Companies,
223 listeners : cfg.storeListeners,
226 field: 'name', direction: 'ASC'
232 forceSelection: true,
234 triggerAction: 'all',
235 tpl: new Ext.Template(
236 '<div class="x-grid-cell-text x-btn button">',
237 '<b>{name}</b> {email}',
240 queryParam: 'query[name]',
241 loadingText: "Searching...",
246 setList : function(ar) {
248 Roo.each(ar, function(a) {
252 toList : function() {
254 this.items.each(function(a) {
265 our_office_id : function(cfg)
268 cfg.listeners = cfg.listeners || {};
270 xtype: 'ComboBoxAdder',
271 fieldLabel: "Office / Department",
273 hiddenName: 'office_id',
274 name : 'office_id_name',
276 qtip : "Select Office",
279 triggerAction: 'all',
283 forceSelection: true,
294 url: baseURL + '/Roo/Office.html',
297 reader: Pman.Readers.Office,
298 listeners : Roo.apply({
299 loadexception : Pman.loadException
300 }, cfg.storeListeners
304 field: 'name', direction: 'ASC'
307 listeners : Roo.apply({
308 adderclick : function()
312 company_id : Pman.Login.authUser.company_id * 1,
313 company_id_name: Pman.Login.authUser.company_id_name,
321 Pman.Preview.tmpDisable();
323 Pman.Dialog.Office.show(ncfg, function(data) {
324 _this.setFromData(data);
325 Pman.Preview.tmpEnable();
332 tpl: new Ext.Template(
333 '<div class="x-grid-cell-text x-btn button">',
334 '<b>{name}</b> {address}',
337 queryParam: 'query[name]',
338 loadingText: "Searching...",
350 * Depreciated - use Pman.I18n directly
354 country: function(cfg) { return Pman.I18n.country(cfg); },
355 language: function(cfg) { return Pman.I18n.language(cfg); },
357 languageList : function(cfg) { return Pman.I18n.languageList(cfg); },
358 countryList : function(cfg) { return Pman.I18n.countryList(cfg); }