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: 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",
87 qtip : "Enter Sent To",
92 xtype: 'ComboBoxAdder',
102 url: baseURL + '/Roo/Companies.html',
105 reader: Pman.Readers.Companies,
107 listeners : Roo.apply(
109 loadexception : Pman.loadException
115 field: 'name', direction: 'ASC'
121 forceSelection: true,
123 triggerAction: 'all',
124 tpl: new Ext.Template(
125 '<div class="x-grid-cell-text x-btn button">',
126 '<b>{name}</b> {address}',
129 queryParam: 'query[name]',
130 loadingText: "Searching...",
139 doctype_name: function(cfg) {
142 // things that might need chnaging
143 name : 'doctype_name',
149 qtip : "Select Document Type",
159 url: baseURL + '/Roo/Document_Types.html',
163 reader: Pman.Readers.Document_Types,
165 beforeload: function(t, o) {
166 //console.log(o.params);
167 o.params.limit = 9999;
169 loadexception : Pman.loadException
174 field: 'name', direction: 'ASC'
182 triggerAction: 'all',
183 //emptyText:'Select a state...',
189 address_list_adder : function(cfg) {
191 cfg.storeListeners = cfg.storeListeners || {};
198 renderer : function(d) {
199 return String.format('{0}',
200 d.name.length ? d.name : d.email
205 xtype: 'ComboBoxLister',
209 qtip : "Select an address to add.",
220 url: baseURL + '/Roo/Person.html',
223 reader: Pman.Readers.Companies,
224 listeners : cfg.storeListeners,
227 field: 'name', direction: 'ASC'
233 forceSelection: true,
235 triggerAction: 'all',
236 tpl: new Ext.Template(
237 '<div class="x-grid-cell-text x-btn button">',
238 '<b>{name}</b> {email}',
241 queryParam: 'query[name]',
242 loadingText: "Searching...",
247 setList : function(ar) {
249 Roo.each(ar, function(a) {
253 toList : function() {
255 this.items.each(function(a) {
266 our_office_id : function(cfg)
269 cfg.listeners = cfg.listeners || {};
271 xtype: 'ComboBoxAdder',
272 fieldLabel: "Office / Department",
274 hiddenName: 'office_id',
275 name : 'office_id_name',
277 qtip : "Select Office",
280 triggerAction: 'all',
284 forceSelection: true,
295 url: baseURL + '/Roo/Office.html',
298 reader: Pman.Readers.Office,
299 listeners : Roo.apply({
300 loadexception : Pman.loadException
301 }, cfg.storeListeners
305 field: 'name', direction: 'ASC'
308 listeners : Roo.apply({
309 adderclick : function()
313 company_id : Pman.Login.authUser.company_id * 1,
314 company_id_name: Pman.Login.authUser.company_id_name,
322 Pman.Preview.tmpDisable();
324 Pman.Dialog.Office.show(ncfg, function(data) {
325 _this.setFromData(data);
326 Pman.Preview.tmpEnable();
333 tpl: new Ext.Template(
334 '<div class="x-grid-cell-text x-btn button">',
335 '<b>{name}</b> {address}',
338 queryParam: 'query[name]',
339 loadingText: "Searching...",
351 * Depreciated - use Pman.I18n directly
355 country: function(cfg) { return Pman.I18n.country(cfg); },
356 language: function(cfg) { return Pman.I18n.language(cfg); },
358 languageList : function(cfg) { return Pman.I18n.languageList(cfg); },
359 countryList : function(cfg) { return Pman.I18n.countryList(cfg); }