1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.MTrackTicket = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
34 resize : function (_self, width, height)
37 _this.form.findField('description').el.setWidth(bw);
38 _this.summaryBox.el.setWidth(bw+30);
39 _this.summaryCol.el.setWidth(bw+45);
40 _this.descCol.el.setWidth(bw+35);
49 title : "Edit or Create Ticket",
53 xtype: 'ContentPanel',
61 actioncomplete : function(_self,action)
63 if (action.type == 'setdata') {
65 this.load({ method: 'GET', params: { '_id' : _this.data.id || 0}});
69 if (action.type == 'load') {
71 this.setValues(_this.data);
77 if (action.type =='submit') {
79 if (!_this.data.id * 1) {
80 Roo.MessageBox.confirm("Close?",
81 "The new ticket id is #" + action.result.data.id + ", Press yes to close, or no to keep editing",
89 _this.callback.call(_this, _this.form.getValues());
94 _this.data.id = action.result.data.id;
95 _this.form.fireEvent('actioncomplete', _this.form, { type : 'setdata', data : {}});
108 if (_this.callback) {
109 _this.callback.call(_this, _this.form.getValues());
116 rendered : function (form)
122 style : 'margin:10px;width:1000px;margin-top:0px;',
123 url : baseURL + '/Roo/mtrack_ticket.php',
134 legend : "Properties",
135 style : 'width:190px;',
140 allowBlank : 'false',
141 displayField : 'name',
143 emptyText : "Select Project",
144 fieldLabel : 'Project',
145 forceSelection : true,
146 hiddenName : 'project_id',
148 loadingText : "Searching...",
150 name : 'project_id_name',
152 qtip : "Select Projects",
153 queryParam : 'query[name]',
154 selectOnFocus : true,
155 tpl : '<div class="x-grid-cell-text x-btn button "><b>{name}</b> </div>',
156 triggerAction : 'all',
164 beforeload : function (_self, o){
165 o.params = o.params || {};
170 sortInfo : { direction : 'ASC', field: 'name' },
175 url : baseURL + '/Roo/Projects.php'
182 totalProperty : 'total',
183 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
191 displayField : 'name',
193 emptyText : "Select milestone",
194 fieldLabel : 'Milestone',
195 forceSelection : true,
196 hiddenName : 'milestone_id',
198 loadingText : "Searching...",
200 name : 'milestone_id_name',
202 qtip : "Select mtrack_milestone",
203 queryParam : 'query[name]',
204 selectOnFocus : true,
205 tpl : '<div class="x-grid-cell-text x-btn button RdYlGn-q{seqid}-{seqmax}"><b>{name}</b> </div>',
206 triggerAction : 'all',
214 beforeload : function (_self, o){
215 o.params = o.params || {};
217 o.params.etype = 'milestone';
218 o.params.project_id = _this.form.findField('project_id').getValue();
219 if (!o.params.project_id) {
220 Roo.MessageBox.alert("Error", "Select Project");
226 sortInfo : { direction : 'ASC', field: 'startdate' },
231 url : baseURL + '/Roo/mtrack_milestone.php'
238 totalProperty : 'total',
239 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
248 displayField : 'name',
250 emptyText : "Select Priority",
251 fieldLabel : 'Priority',
252 forceSelection : true,
253 hiddenName : 'priority_id',
255 loadingText : "Searching...",
257 name : 'priority_id_name',
259 qtip : "Select core_enum",
260 queryParam : 'query[etype]',
261 selectOnFocus : true,
262 tpl : '<div class="x-grid-cell-text x-btn button RdYlGn-q{seqid}-{seqmax}"><b>{name}</b> </div>',
263 triggerAction : 'all',
271 beforeload : function (_self, o){
272 o.params = o.params || {};
274 o.params.etype = 'priority';
278 sortInfo : { direction : 'ASC', field: 'seqid' },
283 url : baseURL + '/Roo/core_enum.php'
290 totalProperty : 'total',
291 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
300 displayField : 'name',
302 emptyText : "Select Severity",
303 fieldLabel : 'Severity',
304 forceSelection : true,
305 hiddenName : 'severity_id',
307 loadingText : "Searching...",
309 name : 'severity_id_name',
311 qtip : "Select core_enum",
312 queryParam : 'query[etype]',
313 selectOnFocus : true,
314 tpl : '<div class="x-grid-cell-text x-btn button RdYlGn-q{seqid}-{seqmax}"><b>{name}</b> </div>',
315 triggerAction : 'all',
323 beforeload : function (_self, o){
324 o.params = o.params || {};
326 o.params.etype = 'severity';
330 sortInfo : { direction : 'ASC', field: 'seqid' },
335 url : baseURL + '/Roo/core_enum.php'
342 totalProperty : 'total',
343 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
352 displayField : 'name',
354 emptyText : "Select Classification",
355 fieldLabel : 'Classification',
356 forceSelection : true,
357 hiddenName : 'classification_id',
359 loadingText : "Searching...",
361 name : 'classification_id_name',
363 qtip : "Select core_enum",
364 queryParam : 'query[etype]',
365 selectOnFocus : true,
366 tpl : '<div class="x-grid-cell-text x-btn button RdYlGn-q{seqid}-{seqmax}"><b>{name}</b> </div>',
367 triggerAction : 'all',
375 beforeload : function (_self, o){
376 o.params = o.params || {};
378 o.params.etype = 'classification';
382 sortInfo : { direction : 'ASC', field: 'seqid' },
387 url : baseURL + '/Roo/core_enum.php'
394 totalProperty : 'total',
395 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
404 legend : "Resources",
405 style : 'width: 190px',
416 allowBlank : 'false',
418 displayField : 'name',
420 emptyText : "Select Person",
421 fieldLabel : 'Developer',
422 forceSelection : true,
423 hiddenName : 'developer_id',
425 loadingText : "Searching...",
427 name : 'developer_id_name',
429 qtip : "Select Person",
430 queryParam : 'query[name]',
431 selectOnFocus : true,
432 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> <{email}> </div>',
433 triggerAction : 'all',
441 beforeload : function (_self, o){
442 o.params = o.params || {};
445 o.params['query[project_id]'] = _this.form.findField('project_id').getValue();
446 if (!o.params['query[project_id]']) {
447 Roo.MessageBox.alert("Error", "Select Project");
450 o.params['query[role]'] = 'DEVELOPER';
454 sortInfo : { direction : 'ASC', field: 'name' },
459 url : baseURL + '/Roo/Person.php'
466 totalProperty : 'total',
467 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
474 allowBlank : 'false',
476 displayField : 'name',
478 emptyText : "Select Person",
479 fieldLabel : 'Owner',
480 forceSelection : true,
481 hiddenName : 'owner_id',
483 loadingText : "Searching...",
485 name : 'owner_id_name',
487 qtip : "Select Person",
488 queryParam : 'query[name]',
489 selectOnFocus : true,
490 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
491 triggerAction : 'all',
499 beforeload : function (_self, o){
500 o.params = o.params || {};
502 o.params['query[project_id]']= _this.form.findField('project_id').getValue();
503 if (!o.params['query[project_id]']) {
504 Roo.MessageBox.alert("Error", "Select Project");
510 sortInfo : { direction : 'ASC', field: 'name' },
515 url : baseURL + '/Roo/Person.php'
522 totalProperty : 'total',
523 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
532 labelAlign : 'right',
537 xtype: 'NumberField',
539 style : 'align:right;',
540 fieldLabel : 'Estimated',
554 show : function (_self)
558 render : function (_self)
560 _this.summaryCol = _self;
563 style : 'margin-left:10px',
570 show : function (_self)
574 render : function (_self)
576 _this.summaryBox = _self;
579 legend : "Summary / Details",
580 style : 'width:410px',
591 fieldLabel : 'Summary',
601 style : 'float:left; width:400px',
608 check : function (_self, checked)
616 _this.form.findField('view_as').setValue('text');
624 var md = _this.form.findField('view_as_markdown');
627 md.setValue(checked ? 0 : 1);
633 fieldLabel : 'View as',
634 name : 'view_as_text',
642 style : 'float: left',
649 check : function (_self, checked)
657 _this.form.findField('view_as').setValue('markdown');
663 var md = _this.form.findField('view_as_text');
666 md.setValue(checked ? 0 : 1);
670 boxLabel : 'markdown',
671 name : 'view_as_markdown',
682 show : function (_self)
686 render : function (_self)
688 _this.descCol = _self;
697 fieldLabel : 'Description',
699 name : 'description',
724 xtype: 'LayoutRegion',
732 click : function (_self, e)
743 click : function (_self, e)
749 _this.form.doAction("submit");