MTrackWeb.Tab.TicketView = new Roo.XComponent({
order : '001-MTrackWeb.Tab.TicketView',
region : 'center',
- parent : false,
- name : "unnamed module",
+ parent : 'Pman',
+ name : "TicketView",
disabled : false,
tree : function()
{
return {
xtype: 'NestedLayoutPanel',
xns: Roo,
+ region : 'center',
+ title : "Tickets",
layout : {
xtype: 'BorderLayout',
xns: Roo,
items : [
+ {
+ xtype: 'GridPanel',
+ xns: Roo,
+ title : "mtrack_ticket",
+ fitToframe : true,
+ fitContainer : true,
+ tableName : 'mtrack_ticket',
+ background : true,
+ region : 'center',
+ listeners : {
+ activate : function() {
+ _this.panel = this;
+ if (_this.grid) {
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
+ grid : {
+ xtype: 'Grid',
+ xns: Roo.grid,
+ autoExpandColumn : 'summary',
+ loadMask : true,
+ listeners : {
+ render : function()
+ {
+ _this.grid = this;
+ //_this.dialog = Pman.Dialog.FILL_IN
+ if (_this.panel.active) {
+ this.footer.onClick('first');
+ }
+ },
+ rowdblclick : function (_self, rowIndex, e)
+ {
+ if (!_this.dialog) return;
+ _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ },
+ dataSource : {
+ xtype: 'Store',
+ xns: Roo.data,
+ remoteSort : true,
+ sortInfo : { field : 'summary', direction: 'ASC' },
+ proxy : {
+ xtype: 'HttpProxy',
+ xns: Roo.data,
+ method : 'GET',
+ url : baseURL + '/Roo/mtrack_ticket.php'
+ },
+ reader : {
+ xtype: 'JsonReader',
+ xns: Roo.data,
+ totalProperty : 'total',
+ root : 'data',
+ id : 'id',
+ fields : [
+ {
+ 'name': 'id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'summary',
+ 'type': 'string'
+ },
+ {
+ 'name': 'description',
+ 'type': 'string'
+ },
+ {
+ 'name': 'changelog',
+ 'type': 'string'
+ },
+ {
+ 'name': 'created',
+ 'type': 'int'
+ },
+ {
+ 'name': 'updated',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'priority_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'severity_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'classification_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'resolution_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'cc',
+ 'type': 'string'
+ },
+ {
+ 'name': 'status',
+ 'type': 'int'
+ },
+ {
+ 'name': 'estimated',
+ 'type': 'float'
+ },
+ {
+ 'name': 'spent',
+ 'type': 'float'
+ },
+ {
+ 'name': 'x_fieldname',
+ 'type': 'string'
+ },
+ {
+ 'name': 'project_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'developer_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'milestone_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'updated_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'updated_person_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'updated_ontable',
+ 'type': 'string'
+ },
+ {
+ 'name': 'updated_onid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'updated_changedate',
+ 'type': 'date'
+ },
+ {
+ 'name': 'updated_reason',
+ 'type': 'string'
+ },
+ {
+ 'name': 'created_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'created_person_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'created_ontable',
+ 'type': 'string'
+ },
+ {
+ 'name': 'created_onid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'created_changedate',
+ 'type': 'date'
+ },
+ {
+ 'name': 'created_reason',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_phone',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_company_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_role',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_lang',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_no_reset_sent',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_action_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_project_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_deleted_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_deleted_dt',
+ 'type': 'date'
+ },
+ {
+ 'name': 'developer_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'developer_id_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'developer_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'developer_id_phone',
+ 'type': 'string'
+ },
+ {
+ 'name': 'developer_id_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'developer_id_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'developer_id_company_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'developer_id_role',
+ 'type': 'string'
+ },
+ {
+ 'name': 'developer_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'developer_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'developer_id_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'developer_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'developer_id_lang',
+ 'type': 'string'
+ },
+ {
+ 'name': 'developer_id_no_reset_sent',
+ 'type': 'int'
+ },
+ {
+ 'name': 'developer_id_action_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'developer_id_project_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'developer_id_deleted_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'developer_id_deleted_dt',
+ 'type': 'date'
+ },
+ {
+ 'name': 'priority_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'priority_id_etype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'priority_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'priority_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'priority_id_seqid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'severity_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'severity_id_etype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'severity_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'severity_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'severity_id_seqid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'classification_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'classification_id_etype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'classification_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'classification_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'classification_id_seqid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'resolution_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'resolution_id_etype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'resolution_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'resolution_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'resolution_id_seqid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'status_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'status_etype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'status_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'status_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'status_seqid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'project_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'project_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'project_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'project_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'project_id_code',
+ 'type': 'string'
+ },
+ {
+ 'name': 'project_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'project_id_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'project_id_client_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'project_id_team_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'project_id_file_location',
+ 'type': 'string'
+ },
+ {
+ 'name': 'project_id_open_date',
+ 'type': 'date'
+ },
+ {
+ 'name': 'project_id_open_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'project_id_close_date',
+ 'type': 'date'
+ },
+ {
+ 'name': 'project_id_countries',
+ 'type': 'string'
+ },
+ {
+ 'name': 'project_id_languages',
+ 'type': 'string'
+ },
+ {
+ 'name': 'project_id_agency_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'milestone_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'milestone_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'milestone_id_description',
+ 'type': 'string'
+ },
+ {
+ 'name': 'milestone_id_startdate',
+ 'type': 'date'
+ },
+ {
+ 'name': 'milestone_id_duedate',
+ 'type': 'date'
+ },
+ {
+ 'name': 'milestone_id_completed',
+ 'type': 'date'
+ },
+ {
+ 'name': 'milestone_id_deleted',
+ 'type': 'int'
+ },
+ {
+ 'name': 'milestone_id_created',
+ 'type': 'int'
+ },
+ {
+ 'name': 'milestone_id_updated',
+ 'type': 'int'
+ },
+ {
+ 'name': 'milestone_id_project_id',
+ 'type': 'int'
+ }
+ ]
+ }
+ },
+ footer : {
+ xtype: 'PagingToolbar',
+ xns: Roo,
+ pageSize : 25,
+ displayInfo : true,
+ displayMsg : 'Displaying mtrack_ticket{0} - {1} of {2}',
+ emptyMsg : 'No mtrack_ticket found'
+ },
+ toolbar : {
+ xtype: 'Toolbar',
+ xns: Roo,
+ items : [
+ {
+ xtype: 'Fill',
+ xns: Roo.Toolbar
+ },
+ {
+ xtype: 'Button',
+ xns: Roo.Toolbar,
+ listeners : {
+ click : function()
+ {
+ if (!_this.dialog) return;
+ _this.dialog.show( { id : 0 } , function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ },
+ cls : 'x-btn-text-icon',
+ text : "Create Ticket",
+ icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
+ },
+ {
+ xtype: 'Button',
+ xns: Roo.Toolbar,
+ text : "Edit",
+ cls : 'x-btn-text-icon',
+ icon : Roo.rootURL + 'images/default/tree/leaf.gif',
+ listeners : {
+ click : function()
+ {
+ var s = _this.grid.getSelectionModel().getSelections();
+ if (!s.length || (s.length > 1)) {
+ Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
+ return;
+ }
+ if (!_this.dialog) return;
+ _this.dialog.show(s[0].data, function() {
+ _this.grid.footer.onClick('first');
+ });
+
+ }
+ }
+ },
+ {
+ xtype: 'Button',
+ xns: Roo.Toolbar,
+ listeners : {
+ click : function()
+ {
+ Pman.genericDelete(_this, 'mtrack_ticket');
+ }
+ },
+ cls : 'x-btn-text-icon',
+ text : "Quick Close",
+ icon : rootURL + '/Pman/templates/images/trash.gif'
+ }
+ ]
+ },
+ colModel : [
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Id',
+ width : 75,
+ dataIndex : 'id',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Summary',
+ width : 200,
+ dataIndex : 'summary',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Project',
+ width : 75,
+ dataIndex : 'project_id',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Milestone',
+ width : 75,
+ dataIndex : 'milestone_id',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Owner',
+ width : 75,
+ dataIndex : 'owner_id',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Created',
+ width : 75,
+ dataIndex : 'created',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Updated',
+ width : 75,
+ dataIndex : 'updated',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Priority',
+ width : 75,
+ dataIndex : 'priority_id',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Severity',
+ width : 75,
+ dataIndex : 'severity_id',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Classification',
+ width : 75,
+ dataIndex : 'classification_id',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Estimated',
+ width : 75,
+ dataIndex : 'estimated',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Spent',
+ width : 75,
+ dataIndex : 'spent',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Project',
+ width : 75,
+ dataIndex : 'project_id',
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ header : 'Developer',
+ width : 75,
+ dataIndex : 'developer_id',
+ renderer : function(v) { return String.format('{0}', v); }
+ }
+ ]
+ }
+ },
{
xtype: 'ContentPanel',
xns: Roo,
autoScroll : true,
- region : 'center',
+ region : 'east',
title : "Add / Edit Ticket",
adjustments : [30, 30],
items : [
{
xtype: 'Column',
xns: Roo.form,
- width : '420px',
- items : [
- {
- xtype: 'FieldSet',
- xns: Roo.form,
- labelAlign : 'top',
- legend : "Summary / Details",
- items : [
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Summary',
- name : 'summary',
- width : 400
- },
- {
- xtype: 'TextArea',
- xns: Roo.form,
- fieldLabel : 'Description',
- height : 200,
- name : 'description',
- width : 400
- }
- ]
- },
- {
- xtype: 'FieldSet',
- xns: Roo.form,
- labelAlign : 'top',
- legend : "Add Comment",
- items : [
- {
- xtype: 'TextArea',
- xns: Roo.form,
- fieldLabel : 'Comment',
- height : 150,
- name : 'description',
- width : 400
- }
- ]
- },
- {
- xtype: 'FieldSet',
- xns: Roo.form,
- labelAlign : 'top',
- legend : "History",
- items : [
- {
- xtype: 'DisplayField',
- xns: Roo.form,
- value : "... last few items of history goes in here.."
- }
- ]
- }
- ]
- },
- {
- xtype: 'Column',
- xns: Roo.form,
- style : 'margin-left: 10px',
width : 200,
items : [
{
xtype: 'HttpProxy',
xns: Roo.data,
method : 'GET',
- url : baseURL + '/Roo/Projects.php'
+ url : baseURL + '/Roo/core_project.php'
},
reader : {
xtype: 'JsonReader',
}
]
},
+ {
+ xtype: 'Column',
+ xns: Roo.form,
+ style : 'margin-left:10px',
+ width : '420px',
+ items : [
+ {
+ xtype: 'FieldSet',
+ xns: Roo.form,
+ labelAlign : 'top',
+ legend : "Summary / Details",
+ items : [
+ {
+ xtype: 'TextField',
+ xns: Roo.form,
+ fieldLabel : 'Summary',
+ name : 'summary',
+ width : 400
+ },
+ {
+ xtype: 'TextArea',
+ xns: Roo.form,
+ fieldLabel : 'Description',
+ height : 200,
+ name : 'description',
+ width : 400
+ }
+ ]
+ },
+ {
+ xtype: 'FieldSet',
+ xns: Roo.form,
+ labelAlign : 'top',
+ legend : "Add Comment",
+ items : [
+ {
+ xtype: 'TextArea',
+ xns: Roo.form,
+ fieldLabel : 'Comment',
+ height : 150,
+ name : 'comment',
+ width : 400
+ },
+ {
+ xtype: 'Button',
+ xns: Roo,
+ text : "Add Comment"
+ }
+ ]
+ },
+ {
+ xtype: 'FieldSet',
+ xns: Roo.form,
+ labelAlign : 'top',
+ legend : "History",
+ items : [
+ {
+ xtype: 'DisplayField',
+ xns: Roo.form,
+ value : "... last few items of history goes in here.."
+ }
+ ]
+ }
+ ]
+ },
{
xtype: 'Column',
xns: Roo.form,
style : 'margin-left: 10px',
width : 200,
items : [
+ {
+ xtype: 'FieldSet',
+ xns: Roo.form,
+ labelAlign : 'top',
+ legend : "Schedule Work",
+ items : [
+ {
+ xtype: 'DateField',
+ xns: Roo.form,
+ fieldLabel : 'Tagged to start on'
+ }
+ ]
+ },
+ {
+ xtype: 'FieldSet',
+ xns: Roo.form,
+ labelAlign : 'top',
+ legend : "Attachments",
+ items : [
+ {
+ xtype: 'TextField',
+ xns: Roo.form,
+ fieldLabel : 'Add File',
+ inputType : 'file',
+ name : 'files[]',
+ qtip : ""
+ }
+ ]
+ },
+ {
+ xtype: 'FieldSet',
+ xns: Roo.form,
+ labelAlign : 'top',
+ legend : "Watching",
+ items : [
+ {
+ xtype: 'ComboBox',
+ xns: Roo.form,
+ displayField : 'name',
+ emptyText : "Select Person",
+ fieldLabel : 'Person',
+ forceSelection : true,
+ hiddenName : 'watcher_add_id',
+ listWidth : 400,
+ loadingText : "Searching...",
+ minChars : 2,
+ name : 'watcher_add',
+ pageSize : 20,
+ qtip : "Select Person",
+ queryParam : 'query[name]',
+ selectOnFocus : true,
+ tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'id',
+ width : 180,
+ store : {
+ xtype: 'Store',
+ xns: Roo.data,
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'id' },
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ }
+ },
+ proxy : {
+ xtype: 'HttpProxy',
+ xns: Roo.data,
+ method : 'GET',
+ url : baseURL + '/Roo/Person.php'
+ },
+ reader : {
+ xtype: 'JsonReader',
+ xns: Roo.data,
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
+ }
+ }
+ },
+ {
+ xtype: 'DisplayField',
+ xns: Roo.form,
+ value : "..existing watchers..."
+ }
+ ]
+ },
{
xtype: 'FieldSet',
xns: Roo.form,
{
xtype: 'FieldSet',
xns: Roo.form,
- legend : "Attachments",
+ labelAlign : 'top',
+ legend : "Logged work",
items : [
{
- xtype: 'TextField',
+ xtype: 'DisplayField',
xns: Roo.form,
- fieldLabel : 'Add File',
- inputType : 'file',
- name : 'files[]',
- qtip : ""
+ value : "... timesheet references?..."
}
]
- },
- {
- xtype: 'FieldSet',
- xns: Roo.form,
- legend : "Watching"
}
]
},
xtype: 'ContentPanel',
xns: Roo,
background : true,
- region : 'center',
+ region : 'east',
title : "Full history"
}
],
center : {
+ xtype: 'LayoutRegion',
+ xns: Roo
+ },
+ east : {
xtype: 'LayoutRegion',
xns: Roo,
- tabPosition : 'top'
+ collapsible : true,
+ tabPosition : 'top',
+ title : "Ticket Details",
+ width : 550
+ },
+ center : {
+ xtype: 'LayoutRegion',
+ xns: Roo
}
}
};