{ "id": "roo-file-232", "name": "Pman.Dialog.MTrackTicket", "parent": "", "title": "", "path": "/home/alan/gitlive/Pman.MTrack/Pman.Dialog.MTrackTicket.bjs", "items": [ { "listeners": { "resize": "function (_self, width, height)\n{\n var bw = width - 320;\n _this.form.findField('description').el.setWidth(bw);\n _this.summaryBox.el.setWidth(bw+30);\n _this.summaryCol.el.setWidth(bw+45);\n _this.descCol.el.setWidth(bw+35);\n \n}" }, "closable": false, "collapsible": false, "height": 450, "modal": true, "resizable": true, "title": "Edit or Create Ticket", "width": 700, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "region": "center", "xtype": "ContentPanel", "|xns": "Roo", "items": [ { "listeners": { "|actioncomplete": "function(_self,action)\n{\n if (action.type == 'setdata') {\n \n this.load({ method: 'GET', params: { '_id' : _this.data.id || 0}});\n \n return;\n }\n if (action.type == 'load') {\n if (!_this.data.id) {\n this.setValues(_this.data);\n }\n return;\n }\n \n \n if (action.type =='submit') {\n \n if (!_this.data.id * 1) {\n Roo.MessageBox.confirm(\"Close?\", \n \"The new ticket id is #\" + action.result.data.id + \", Press yes to close, or no to keep editing\",\n function (res) {\n if (res == 'yes') {\n \n \n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(_this, _this.form.getValues());\n }\n _this.form.reset(); \n return;\n }\n _this.data.id = action.result.data.id;\n _this.form.fireEvent('actioncomplete', _this.form, { type : 'setdata', data : {}});\n return;\n }\n );\n \n \n \n \n return;\n }\n \n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(_this, _this.form.getValues());\n }\n _this.form.reset(); \n\n return;\n }\n}\n", "|rendered": "function (form)\n{\n _this.form= form;\n}\n" }, "method": "POST", "style": "margin:10px;width:1000px;margin-top:0px;", "xtype": "Form", "|url": "baseURL + '/Roo/mtrack_ticket.php'", "|xns": "Roo.form", "items": [ { "width": 210, "xtype": "Column", "|xns": "Roo.form", "items": [ { "labelAlign": "top", "legend": "Properties", "style": "width:190px;", "xtype": "FieldSet", "|xns": "Roo.form", "items": [ { "allowBlank": "false", "displayField": "name", "editable": "false", "emptyText": "Select Project", "fieldLabel": "Project", "forceSelection": true, "hiddenName": "project_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "project_id_name", "pageSize": 20, "qtip": "Select Projects", "queryParam": "query[name]", "selectOnFocus": true, "tpl": "
{name}
", "triggerAction": "all", "typeAhead": true, "valueField": "id", "width": 180, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'name' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/Projects.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]" } ] } ] }, { "alwaysQuery": true, "displayField": "name", "editable": "false", "emptyText": "Select milestone", "fieldLabel": "Milestone", "forceSelection": true, "hiddenName": "milestone_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "milestone_id_name", "pageSize": 20, "qtip": "Select mtrack_milestone", "queryParam": "query[name]", "selectOnFocus": true, "tpl": "
{name}
", "triggerAction": "all", "typeAhead": true, "valueField": "id", "width": 180, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.etype = 'milestone';\n o.params.project_id = _this.form.findField('project_id').getValue();\n if (!o.params.project_id) {\n Roo.MessageBox.alert(\"Error\", \"Select Project\");\n return false;\n }\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'startdate' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/mtrack_milestone.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]" } ] } ] }, { "allowBlank": false, "alwaysQuery": true, "displayField": "name", "editable": "false", "emptyText": "Select Priority", "fieldLabel": "Priority", "forceSelection": true, "hiddenName": "priority_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "priority_id_name", "pageSize": 20, "qtip": "Select core_enum", "queryParam": "query[etype]", "selectOnFocus": true, "tpl": "
{name}
", "triggerAction": "all", "typeAhead": true, "valueField": "id", "width": 180, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.etype = 'priority';\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'seqid' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/core_enum.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"etype\",\"type\":\"string\"}]" } ] } ] }, { "allowBlank": false, "alwaysQuery": true, "displayField": "name", "editable": "false", "emptyText": "Select Severity", "fieldLabel": "Severity", "forceSelection": true, "hiddenName": "severity_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "severity_id_name", "pageSize": 20, "qtip": "Select core_enum", "queryParam": "query[etype]", "selectOnFocus": true, "tpl": "
{name}
", "triggerAction": "all", "typeAhead": true, "valueField": "id", "width": 180, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.etype = 'severity';\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'seqid' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/core_enum.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"etype\",\"type\":\"string\"}]" } ] } ] }, { "allowBlank": false, "alwaysQuery": true, "displayField": "name", "editable": "false", "emptyText": "Select Classification", "fieldLabel": "Classification", "forceSelection": true, "hiddenName": "classification_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "classification_id_name", "pageSize": 20, "qtip": "Select core_enum", "queryParam": "query[etype]", "selectOnFocus": true, "tpl": "
{name}
", "triggerAction": "all", "typeAhead": true, "valueField": "id", "width": 180, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.etype = 'classification';\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'seqid' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/core_enum.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"etype\",\"type\":\"string\"}]" } ] } ] } ] }, { "legend": "Resources", "style": "width: 190px", "xtype": "FieldSet", "|xns": "Roo.form", "items": [ { "labelAlign": "top", "width": 190, "xtype": "Column", "|xns": "Roo.form", "items": [ { "allowBlank": "false", "alwaysQuery": true, "displayField": "name", "editable": "false", "emptyText": "Select Person", "fieldLabel": "Developer", "forceSelection": true, "hiddenName": "developer_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "developer_id_name", "pageSize": 20, "qtip": "Select Person", "queryParam": "query[name]", "selectOnFocus": true, "tpl": "
{name} <{email}>
", "triggerAction": "all", "typeAhead": true, "valueField": "id", "width": 180, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n \n // set more here\n o.params['query[project_id]'] = _this.form.findField('project_id').getValue();\n if (!o.params['query[project_id]']) {\n Roo.MessageBox.alert(\"Error\", \"Select Project\");\n return false;\n }\n o.params['query[role]'] = 'DEVELOPER';\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'name' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/Person.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]" } ] } ] }, { "allowBlank": "false", "alwaysQuery": true, "displayField": "name", "editable": "false", "emptyText": "Select Person", "fieldLabel": "Owner", "forceSelection": true, "hiddenName": "owner_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "owner_id_name", "pageSize": 20, "qtip": "Select Person", "queryParam": "query[name]", "selectOnFocus": true, "tpl": "
{name}
", "triggerAction": "all", "typeAhead": true, "valueField": "id", "width": 180, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params['query[project_id]']= _this.form.findField('project_id').getValue();\n if (!o.params['query[project_id]']) {\n Roo.MessageBox.alert(\"Error\", \"Select Project\");\n return false;\n }\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'name' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/Person.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]" } ] } ] } ] }, { "labelAlign": "right", "labelWidth": 100, "width": 190, "xtype": "Column", "|xns": "Roo.form", "items": [ { "style": "align:right;", "fieldLabel": "Estimated", "name": "estimated", "width": 75, "xtype": "NumberField", "|xns": "Roo.form" } ] } ] } ] }, { "listeners": { "show": "function (_self)\n{\n\n}", "render": "function (_self)\n{\n _this.summaryCol = _self;\n}" }, "style": "margin-left:10px", "width": 430, "xtype": "Column", "|xns": "Roo.form", "items": [ { "listeners": { "show": "function (_self)\n{\n\n}", "render": "function (_self)\n{\n _this.summaryBox = _self;\n}" }, "legend": "Summary / Details", "style": "width:410px", "xtype": "FieldSet", "|xns": "Roo.form", "items": [ { "labelAlign": "top", "width": 400, "xtype": "Column", "|xns": "Roo.form", "items": [ { "fieldLabel": "Summary", "name": "summary", "width": 400, "xtype": "TextField", "|xns": "Roo.form" } ] }, { "labelWidth": 70, "style": "float:left; width:400px", "width": 400, "xtype": "Row", "|xns": "Roo.form", "items": [ { "listeners": { "check": "function (_self, checked)\n{\n\n if (!_this.form) {\n return;\n }\n if (checked) {\n \n _this.form.findField('view_as').setValue('text');\n }\n \n \n \n if (this.radio) {\n return;\n }\n var md = _this.form.findField('view_as_markdown');\n\n md.radio = true;\n md.setValue(checked ? 0 : 1);\n \n md.radio = false;\n}" }, "boxLabel": "text", "fieldLabel": "View as", "name": "view_as_text", "value": 1, "width": 100, "xtype": "Checkbox", "|xns": "Roo.form" }, { "hideLabels": true, "style": "float: left", "width": 100, "xtype": "Row", "|xns": "Roo.form", "items": [ { "listeners": { "check": "function (_self, checked)\n{\n if (!_this.form) {\n return;\n }\n \n if (checked) {\n \n _this.form.findField('view_as').setValue('markdown');\n }\n \n if (this.radio) {\n return;\n }\n var md = _this.form.findField('view_as_text');\n\n md.radio = true;\n md.setValue(checked ? 0 : 1);\n md.radio = false;\n}" }, "boxLabel": "markdown", "name": "view_as_markdown", "value": 1, "xtype": "Checkbox", "|xns": "Roo.form" } ] } ] }, { "listeners": { "show": "function (_self)\n{\n\n}", "render": "function (_self)\n{\n _this.descCol = _self;\n}" }, "labelAlign": "top", "width": 400, "xtype": "Column", "|xns": "Roo.form", "items": [ { "fieldLabel": "Description", "height": 250, "name": "description", "width": 400, "xtype": "TextArea", "|xns": "Roo.form" } ] } ] } ] }, { "name": "id", "|xns": "Roo.form", "xtype": "Hidden" }, { "name": "view_as", "xtype": "Hidden", "|xns": "Roo.form" } ] } ] }, { "listeners": { "click": "function (_self, e)\n{\n _this.dialog.hide();\n}" }, "*prop": "buttons[]", "text": "Cancel", "xtype": "Button", "|xns": "Roo" }, { "listeners": { "click": "function (_self, e)\n{\n // do some checks?\n \n \n \n _this.form.doAction(\"submit\");\n\n}" }, "*prop": "buttons[]", "text": "Save", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }