From: Alan Knowles Date: Tue, 28 Mar 2017 08:41:07 +0000 (+0800) Subject: Pman.Dialog.CoreProject.bjs X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=344ba389c7497814ba3de2994e7c7c100d54e2bf Pman.Dialog.CoreProject.bjs Pman.Dialog.CoreProject.js --- diff --git a/Pman.Dialog.CoreProject.bjs b/Pman.Dialog.CoreProject.bjs index fce76a83..78b7c63a 100644 --- a/Pman.Dialog.CoreProject.bjs +++ b/Pman.Dialog.CoreProject.bjs @@ -1,315 +1,336 @@ { - "id": "roo-file-28", - "name": "Pman.Dialog.CoreProject", - "parent": "", - "title": "", - "path": "/home/chris/gitlive/Pman.Core/Pman.Dialog.CoreProject.bjs", - "items": [ + "name" : "Pman.Dialog.CoreProject", + "parent" : "", + "title" : "", + "path" : "/home/alan/gitlive/Pman.Core/Pman.Dialog.CoreProject.bjs", + "permname" : "", + "modOrder" : "001", + "strings" : { + "99b344c8ae43e3e7213862b8f35c4e51" : "Select Company", + "231bc72756b5e6de492aaaa1577f61b1" : "Remarks", + "577d7068826de925ea2aec01dbadf5e4" : "Client", + "ca528d836417871a349312db705a1951" : "Open date", + "ddb016a244ff2b895e69d25fb3b5f780" : "Edit / Create Projects", + "b5b20a9df20ea61c1cc0485f5e83891e" : "Select Project Type", + "1243daf593fa297e07ab03bf06d925af" : "Searching...", + "ea4788705e6873b424c65e91c2846b19" : "Cancel", + "9675747b5ab12d05f18518761e68a533" : "Select Companies", + "ac848fa228f49ba2b8a5fbd76596817d" : "Team", + "24f9e53eb92c0995d04433c1f7a4c9c0" : "File location", + "d1847fa47ea6bc047b413947463262ab" : "Enter Project Name", + "340c2ee497b85d5954b01c64de7f44f6" : "Select Person", + "1a11b1adc359c03db0ca798a00e2632c" : "Opened", + "8e3a42158ee70b67cf55b33e2789a9e5" : "Project Name", + "ca0dbad92a874b2f69b549293387925e" : "Code", + "245fe794333c2b0d5c513129b346b93f" : "Project Type", + "ab83ccde6764ca581702f38d79834615" : "Select Team", + "c9cc8cce247e49bae79f15173ce97354" : "Save", + "223aad18ce30620a724d8a97021ce26e" : "Open by" + }, + "items" : [ + { + "collapsible" : false, + "title" : "Edit / Create Projects", + "xtype" : "LayoutDialog", + "width" : 470, + "$ xns" : "Roo", + "closable" : false, + "resizable" : false, + "height" : 450, + "items" : [ + { + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "* prop" : "center" + }, + { + "region" : "center", + "xtype" : "ContentPanel", + "$ xns" : "Roo", + "items" : [ + { + "listeners" : { + "|actioncomplete" : "function(_self,action)\n{\n if (action.type == 'setdata') {\n //_this.dialog.el.mask(\"Loading\");\n //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n return;\n }\n if (action.type == 'load') {\n _this.dialog.el.unmask();\n return;\n }\n if (action.type =='submit') {\n \n _this.dialog.el.unmask();\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}\n", + "|rendered" : "function (form)\n{\n _this.form= form;\n}\n" + }, + "$ url" : "baseURL + '/Roo/Projects.php'", + "xtype" : "Form", + "method" : "POST", + "style" : "margin:10px;", + "$ xns" : "Roo.form", + "items" : [ { - "closable": false, - "collapsible": false, - "height": 450, - "resizable": false, - "title": "Edit / Create Projects", - "width": 470, - "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 //_this.dialog.el.mask(\"Loading\");\n //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n return;\n }\n if (action.type == 'load') {\n _this.dialog.el.unmask();\n return;\n }\n if (action.type =='submit') {\n \n _this.dialog.el.unmask();\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}\n", - "|rendered": "function (form)\n{\n _this.form= form;\n}\n" - }, - "method": "POST", - "style": "margin:10px;", - "xtype": "Form", - "|url": "baseURL + '/Roo/Projects.php'", - "|xns": "Roo.form", - "items": [ - { - "fieldLabel": "Code", - "name": "code", - "width": 150, - "xtype": "TextField", - "|xns": "Roo.form" - }, - { - "fieldLabel": "Project Name", - "name": "name", - "qtip": "Enter Project Name", - "width": 300, - "xtype": "TextField", - "|xns": "Roo.form" - }, - { - "allowBlank": false, - "displayField": "desc", - "editable": false, - "emptyText": "Select Project Type", - "fieldLabel": "Project Type", - "forceSelection": true, - "hiddenName": "type", - "listWidth": 400, - "loadingText": "Searching...", - "minChars": 2, - "name": "type_desc", - "pageSize": 20, - "qtip": "Select Project Type", - "queryParam": "query[name]", - "selectOnFocus": true, - "tpl": "
{desc}
", - "triggerAction": "all", - "typeAhead": true, - "valueField": "code", - "width": 200, - "xtype": "ComboBox", - "|xns": "Roo.form", - "items": [ - { - "*prop": "store", - "|data": "[ [ 'U' , \"Project (Unconfirmed)\" ],\n[ 'P' , \"Project\" ],\n[ 'C' , \"Project (Closed)\" ],\n[ 'N' , \"Non-Project\" ],\n[ 'X' , \"Non-Project (Closed)\" ]\n]", - "|fields": " [ 'code', 'desc' ]", - "xtype": "SimpleStore", - "|xns": "Roo.data" - } - ] - }, - { - "listeners": { - "add": "function (combo)\n{\n Pman.Dialog.Companies.show( { id: 0 }, function(data) {\n _this.form.setValues({ \n client_id : data.id,\n client_id_name : data.name\n });\n }); \n}" - }, - "allowBlank": "false", - "displayField": "name", - "editable": "false", - "emptyText": "Select Company", - "fieldLabel": "Client", - "forceSelection": true, - "hiddenName": "client_id", - "listWidth": 400, - "loadingText": "Searching...", - "minChars": 2, - "name": "client_id_name", - "pageSize": 20, - "qtip": "Select Companies", - "queryParam": "query[name]", - "selectOnFocus": true, - "tpl": "
{name}
", - "triggerAction": "all", - "typeAhead": true, - "valueField": "id", - "width": 300, - "xtype": "ComboBox", - "|xns": "Roo.form", - "items": [ - { - "listeners": { - "|beforeload": "function (_self, o){\n o.params = o.params || {};\n \n o.params.type = 1;\n o.params['query[group_pulldown]'] = 1;\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/Companies.php'" - }, - { - "*prop": "reader", - "xtype": "JsonReader", - "|xns": "Roo.data", - "id": "id", - "root": "data", - "totalProperty": "total", - "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"code\",\"type\":\"string\"}]" - } - ] - } - ] - }, - { - "allowBlank": "false", - "displayField": "name", - "editable": "false", - "emptyText": "Select Team", - "fieldLabel": "Team", - "forceSelection": true, - "hiddenName": "team_id", - "listWidth": 400, - "loadingText": "Searching...", - "minChars": 2, - "name": "team_id_name", - "pageSize": 20, - "qtip": "Select Team", - "queryParam": "query[name]", - "selectOnFocus": true, - "tpl": "
{name}
", - "triggerAction": "all", - "typeAhead": true, - "valueField": "id", - "width": 300, - "xtype": "ComboBox", - "|xns": "Roo.form", - "items": [ - { - "*prop": "store", - "xtype": "Store", - "|xns": "Roo.data", - "remoteSort": true, - "|sortInfo": "{ direction : 'ASC', field: 'id' }", - "listeners": { - "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" - }, - "items": [ - { - "*prop": "proxy", - "xtype": "HttpProxy", - "method": "GET", - "|xns": "Roo.data", - "|url": "baseURL + '/Roo/Groups.php'" - }, - { - "*prop": "reader", - "xtype": "JsonReader", - "|xns": "Roo.data", - "id": "id", - "root": "data", - "totalProperty": "total", - "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]" - } - ] - } - ] - }, - { - "fieldLabel": "File location", - "name": "file_location", - "width": 300, - "xtype": "TextField", - "|xns": "Roo.form" - }, - { - "fieldLabel": "Remarks", - "height": 100, - "name": "remarks", - "width": 300, - "xtype": "TextArea", - "|xns": "Roo.form" - }, - { - "legend": "Opened", - "xtype": "FieldSet", - "|xns": "Roo.form", - "items": [ - { - "altFormats": "Y-m-d|d/m/Y", - "fieldLabel": "Open date", - "format": "d/m/Y", - "name": "open_date", - "width": 100, - "xtype": "DateField", - "|xns": "Roo.form" - }, - { - "|xns": "Roo.form", - "xtype": "ComboBox", - "allowBlank": "false", - "editable": "false", - "emptyText": "Select Person", - "forceSelection": true, - "listWidth": 400, - "loadingText": "Searching...", - "minChars": 2, - "pageSize": 20, - "qtip": "Select Person", - "selectOnFocus": true, - "triggerAction": "all", - "typeAhead": true, - "width": 300, - "tpl": "
{name}
", - "queryParam": "query[name]", - "fieldLabel": "Open by", - "valueField": "id", - "displayField": "name", - "hiddenName": "open_by", - "name": "open_by_name", - "items": [ - { - "*prop": "store", - "xtype": "Store", - "|xns": "Roo.data", - "remoteSort": true, - "|sortInfo": "{ direction : 'ASC', field: 'id' }", - "listeners": { - "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" - }, - "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\"}]" - } - ] - } - ] - } - ] - }, - { - "name": "id", - "|xns": "Roo.form", - "xtype": "Hidden" - } - ] - } - ] - }, - { - "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 _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}" - }, - "*prop": "buttons[]", - "text": "Save", - "xtype": "Button", - "|xns": "Roo" - } - ] + "fieldLabel" : "Code", + "xtype" : "TextField", + "width" : 150, + "$ xns" : "Roo.form", + "name" : "code" + }, + { + "fieldLabel" : "Project Name", + "xtype" : "TextField", + "width" : 300, + "$ xns" : "Roo.form", + "qtip" : "Enter Project Name", + "name" : "name" + }, + { + "listWidth" : 400, + "triggerAction" : "all", + "fieldLabel" : "Project Type", + "forceSelection" : true, + "selectOnFocus" : true, + "pageSize" : 20, + "displayField" : "desc", + "emptyText" : "Select Project Type", + "hiddenName" : "type", + "minChars" : 2, + "valueField" : "code", + "xtype" : "ComboBox", + "allowBlank" : false, + "typeAhead" : true, + "editable" : false, + "width" : 200, + "$ xns" : "Roo.form", + "name" : "type_desc", + "qtip" : "Select Project Type", + "queryParam" : "query[name]", + "tpl" : "
{desc}
", + "loadingText" : "Searching...", + "items" : [ + { + "xtype" : "SimpleStore", + "$ data" : "[ [ 'U' , \"Project (Unconfirmed)\" ],\n[ 'P' , \"Project\" ],\n[ 'C' , \"Project (Closed)\" ],\n[ 'N' , \"Non-Project\" ],\n[ 'X' , \"Non-Project (Closed)\" ]\n]", + "$ fields" : " [ 'code', 'desc' ]", + "$ xns" : "Roo.data", + "* prop" : "store" + } + ] + }, + { + "listeners" : { + "add" : "function (combo)\n{\n Pman.Dialog.Companies.show( { id: 0 }, function(data) {\n _this.form.setValues({ \n client_id : data.id,\n client_id_name : data.name\n });\n }); \n}" + }, + "listWidth" : 400, + "triggerAction" : "all", + "fieldLabel" : "Client", + "forceSelection" : true, + "selectOnFocus" : true, + "pageSize" : 20, + "displayField" : "name", + "emptyText" : "Select Company", + "hiddenName" : "client_id", + "minChars" : 2, + "valueField" : "id", + "xtype" : "ComboBox", + "allowBlank" : false, + "typeAhead" : true, + "editable" : false, + "width" : 300, + "$ xns" : "Roo.form", + "name" : "client_id_name", + "qtip" : "Select Companies", + "queryParam" : "query[name]", + "tpl" : "
{name}
", + "loadingText" : "Searching...", + "items" : [ + { + "listeners" : { + "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n \n o.params.type = 1;\n o.params['query[group_pulldown]'] = 1;\n}\n" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ direction : 'ASC', field: 'name' }", + "$ xns" : "Roo.data", + "* prop" : "store", + "items" : [ + { + "$ url" : "baseURL + '/Roo/core_company'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"code\",\"type\":\"string\"}]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + } + ] + }, + { + "listWidth" : 400, + "triggerAction" : "all", + "fieldLabel" : "Team", + "forceSelection" : true, + "selectOnFocus" : true, + "pageSize" : 20, + "displayField" : "name", + "emptyText" : "Select Team", + "hiddenName" : "team_id", + "minChars" : 2, + "valueField" : "id", + "xtype" : "ComboBox", + "allowBlank" : false, + "typeAhead" : true, + "editable" : false, + "width" : 300, + "$ xns" : "Roo.form", + "name" : "team_id_name", + "qtip" : "Select Team", + "queryParam" : "query[name]", + "tpl" : "
{name}
", + "loadingText" : "Searching...", + "items" : [ + { + "listeners" : { + "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ xns" : "Roo.data", + "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", + "* prop" : "store", + "items" : [ + { + "$ url" : "baseURL + '/Roo/Groups.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + } + ] + }, + { + "fieldLabel" : "File location", + "xtype" : "TextField", + "width" : 300, + "$ xns" : "Roo.form", + "name" : "file_location" + }, + { + "fieldLabel" : "Remarks", + "xtype" : "TextArea", + "width" : 300, + "$ xns" : "Roo.form", + "name" : "remarks", + "height" : 100 + }, + { + "legend" : "Opened", + "xtype" : "FieldSet", + "$ xns" : "Roo.form", + "items" : [ + { + "format" : "d/m/Y", + "fieldLabel" : "Open date", + "xtype" : "DateField", + "width" : 100, + "$ xns" : "Roo.form", + "altFormats" : "Y-m-d|d/m/Y", + "name" : "open_date" + }, + { + "listWidth" : 400, + "triggerAction" : "all", + "forceSelection" : true, + "selectOnFocus" : true, + "fieldLabel" : "Open by", + "pageSize" : 20, + "xtype" : "ComboBox", + "emptyText" : "Select Person", + "minChars" : 2, + "valueField" : "id", + "displayField" : "name", + "hiddenName" : "open_by", + "allowBlank" : false, + "typeAhead" : true, + "editable" : false, + "$ xns" : "Roo.form", + "width" : 300, + "qtip" : "Select Person", + "tpl" : "
{name}
", + "queryParam" : "query[name]", + "name" : "open_by_name", + "loadingText" : "Searching...", + "items" : [ + { + "listeners" : { + "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ xns" : "Roo.data", + "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", + "* prop" : "store", + "items" : [ + { + "$ url" : "baseURL + '/Roo/Person.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + } + ] + } + ] + }, + { + "xtype" : "Hidden", + "$ xns" : "Roo.form", + "name" : "id" } - ], - "permname": "", - "modOrder": "001" + ] + } + ] + }, + { + "listeners" : { + "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}" + }, + "text" : "Cancel", + "xtype" : "Button", + "$ xns" : "Roo", + "* prop" : "buttons[]" + }, + { + "listeners" : { + "click" : "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}" + }, + "text" : "Save", + "xtype" : "Button", + "$ xns" : "Roo", + "* prop" : "buttons[]" + } + ] + } + ] } \ No newline at end of file diff --git a/Pman.Dialog.CoreProject.js b/Pman.Dialog.CoreProject.js index fc5ae86c..f2519904 100644 --- a/Pman.Dialog.CoreProject.js +++ b/Pman.Dialog.CoreProject.js @@ -2,369 +2,421 @@ // Auto generated file - created by app.Builder.js- do not edit directly (at present!) +Roo.namespace('Pman.Dialog'); + Pman.Dialog.CoreProject = { - dialog : false, - callback: false, + _strings : { + '99b344c8ae43e3e7213862b8f35c4e51' :"Select Company", + '231bc72756b5e6de492aaaa1577f61b1' :"Remarks", + '577d7068826de925ea2aec01dbadf5e4' :"Client", + 'ca528d836417871a349312db705a1951' :"Open date", + 'ddb016a244ff2b895e69d25fb3b5f780' :"Edit / Create Projects", + 'b5b20a9df20ea61c1cc0485f5e83891e' :"Select Project Type", + '1243daf593fa297e07ab03bf06d925af' :"Searching...", + 'ea4788705e6873b424c65e91c2846b19' :"Cancel", + '9675747b5ab12d05f18518761e68a533' :"Select Companies", + 'ac848fa228f49ba2b8a5fbd76596817d' :"Team", + '24f9e53eb92c0995d04433c1f7a4c9c0' :"File location", + 'd1847fa47ea6bc047b413947463262ab' :"Enter Project Name", + '340c2ee497b85d5954b01c64de7f44f6' :"Select Person", + '1a11b1adc359c03db0ca798a00e2632c' :"Opened", + '8e3a42158ee70b67cf55b33e2789a9e5' :"Project Name", + 'ca0dbad92a874b2f69b549293387925e' :"Code", + '245fe794333c2b0d5c513129b346b93f' :"Project Type", + 'ab83ccde6764ca581702f38d79834615' :"Select Team", + 'c9cc8cce247e49bae79f15173ce97354' :"Save", + '223aad18ce30620a724d8a97021ce26e' :"Open by" + }, - show : function(data, cb) - { - if (!this.dialog) { - this.create(); - } + dialog : false, + callback: false, - this.callback = cb; - this.data = data; - this.dialog.show(this.data._el); - if (this.form) { - this.form.reset(); - this.form.setValues(data); - this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data }); - } + show : function(data, cb) + { + if (!this.dialog) { + this.create(); + } - }, + this.callback = cb; + this.data = data; + this.dialog.show(this.data._el); + if (this.form) { + this.form.reset(); + this.form.setValues(data); + this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data }); + } - create : function() - { - var _this = this; - this.dialog = Roo.factory({ - xtype: 'LayoutDialog', - xns: Roo, - closable : false, - collapsible : false, - height : 450, - resizable : false, - title : "Edit / Create Projects", - width : 470, - items : [ - { - xtype: 'ContentPanel', - xns: Roo, - region : 'center', - items : [ - { - xtype: 'Form', - xns: Roo.form, - listeners : { - actioncomplete : function(_self,action) - { - if (action.type == 'setdata') { - //_this.dialog.el.mask("Loading"); - //this.load({ method: 'GET', params: { '_id' : _this.data.id }}); - return; - } - if (action.type == 'load') { - _this.dialog.el.unmask(); - return; - } - if (action.type =='submit') { - - _this.dialog.el.unmask(); - _this.dialog.hide(); - - if (_this.callback) { - _this.callback.call(_this, _this.form.getValues()); - } - _this.form.reset(); - return; - } - }, - rendered : function (form) - { - _this.form= form; - } - }, - method : 'POST', - style : 'margin:10px;', - url : baseURL + '/Roo/Projects.php', - items : [ - { - xtype: 'TextField', - xns: Roo.form, - fieldLabel : 'Code', - name : 'code', - width : 150 - }, - { - xtype: 'TextField', - xns: Roo.form, - fieldLabel : 'Project Name', - name : 'name', - qtip : "Enter Project Name", - width : 300 - }, - { - xtype: 'ComboBox', - xns: Roo.form, - allowBlank : false, - displayField : 'desc', - editable : false, - emptyText : "Select Project Type", - fieldLabel : 'Project Type', - forceSelection : true, - hiddenName : 'type', - listWidth : 400, - loadingText : "Searching...", - minChars : 2, - name : 'type_desc', - pageSize : 20, - qtip : "Select Project Type", - queryParam : 'query[name]', - selectOnFocus : true, - tpl : '
{desc}
', - triggerAction : 'all', - typeAhead : true, - valueField : 'code', - width : 200, - store : { - xtype: 'SimpleStore', - xns: Roo.data, - data : [ [ 'U' , "Project (Unconfirmed)" ], - [ 'P' , "Project" ], - [ 'C' , "Project (Closed)" ], - [ 'N' , "Non-Project" ], - [ 'X' , "Non-Project (Closed)" ] - ], - fields : [ 'code', 'desc' ] - } - }, - { - xtype: 'ComboBox', - xns: Roo.form, - listeners : { - add : function (combo) - { - Pman.Dialog.CoreCompanies.show( { id: 0 }, function(data) { - _this.form.setValues({ - client_id : data.id, - client_id_name : data.name - }); - }); - } - }, - allowBlank : 'false', - displayField : 'name', - editable : 'false', - emptyText : "Select Company", - fieldLabel : 'Client', - forceSelection : true, - hiddenName : 'client_id', - listWidth : 400, - loadingText : "Searching...", - minChars : 2, - name : 'client_id_name', - pageSize : 20, - qtip : "Select Companies", - queryParam : 'query[name]', - selectOnFocus : true, - tpl : '
{name}
', - triggerAction : 'all', - typeAhead : true, - valueField : 'id', - width : 300, - store : { - xtype: 'Store', - xns: Roo.data, - listeners : { - beforeload : function (_self, o){ - o.params = o.params || {}; - - o.params.type = 1; - o.params['query[group_pulldown]'] = 1; - } - }, - remoteSort : true, - sortInfo : { direction : 'ASC', field: 'name' }, - proxy : { - xtype: 'HttpProxy', - xns: Roo.data, - method : 'GET', - url : baseURL + '/Roo/Companies.php' - }, - reader : { - xtype: 'JsonReader', - xns: Roo.data, - id : 'id', - root : 'data', - totalProperty : 'total', - fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}] - } - } - }, - { - xtype: 'ComboBox', - xns: Roo.form, - allowBlank : 'false', - displayField : 'name', - editable : 'false', - emptyText : "Select Team", - fieldLabel : 'Team', - forceSelection : true, - hiddenName : 'team_id', - listWidth : 400, - loadingText : "Searching...", - minChars : 2, - name : 'team_id_name', - pageSize : 20, - qtip : "Select Team", - queryParam : 'query[name]', - selectOnFocus : true, - tpl : '
{name}
', - triggerAction : 'all', - typeAhead : true, - valueField : 'id', - width : 300, - 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/Groups.php' - }, - reader : { - xtype: 'JsonReader', - xns: Roo.data, - id : 'id', - root : 'data', - totalProperty : 'total', - fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}] - } - } - }, - { - xtype: 'TextField', - xns: Roo.form, - fieldLabel : 'File location', - name : 'file_location', - width : 300 - }, - { - xtype: 'TextArea', - xns: Roo.form, - fieldLabel : 'Remarks', - height : 100, - name : 'remarks', - width : 300 - }, - { - xtype: 'FieldSet', - xns: Roo.form, - legend : "Opened", - items : [ - { - xtype: 'DateField', - xns: Roo.form, - altFormats : 'Y-m-d|d/m/Y', - fieldLabel : 'Open date', - format : 'd/m/Y', - name : 'open_date', - width : 100 - }, - { - xtype: 'ComboBox', - xns: Roo.form, - allowBlank : 'false', - editable : 'false', - emptyText : "Select Person", - forceSelection : true, - listWidth : 400, - loadingText : "Searching...", - minChars : 2, - pageSize : 20, - qtip : "Select Person", - selectOnFocus : true, - triggerAction : 'all', - typeAhead : true, - width : 300, - tpl : '
{name}
', - queryParam : 'query[name]', - fieldLabel : 'Open by', - valueField : 'id', - displayField : 'name', - hiddenName : 'open_by', - name : 'open_by_name', - 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: 'Hidden', - xns: Roo.form, - name : 'id' - } - ] - } - ] - } - ], - center : { - xtype: 'LayoutRegion', - xns: Roo - }, - buttons : [ - { - xtype: 'Button', - xns: Roo, - listeners : { - click : function (_self, e) - { - _this.dialog.hide(); - } - }, - text : "Cancel" - }, - { - xtype: 'Button', - xns: Roo, - listeners : { - click : function (_self, e) - { - // do some checks? - - - _this.dialog.el.mask("Saving"); - _this.form.doAction("submit"); - - } - }, - text : "Save" - } - ] - }); - } + }, + + create : function() + { + var _this = this; + this.dialog = Roo.factory({ + xtype : 'LayoutDialog', + closable : false, + collapsible : false, + height : 450, + resizable : false, + title : _this._strings['ddb016a244ff2b895e69d25fb3b5f780'] /* Edit / Create Projects */, + width : 470, + xns : Roo, + '|xns' : 'Roo', + center : { + xtype : 'LayoutRegion', + xns : Roo, + '|xns' : 'Roo' + }, + buttons : [ + { + xtype : 'Button', + text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */, + listeners : { + click : function (_self, e) + { + _this.dialog.hide(); + } + }, + xns : Roo, + '|xns' : 'Roo' + }, + { + xtype : 'Button', + text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */, + listeners : { + click : function (_self, e) + { + // do some checks? + + + _this.dialog.el.mask("Saving"); + _this.form.doAction("submit"); + + } + }, + xns : Roo, + '|xns' : 'Roo' + } + ], + items : [ + { + xtype : 'ContentPanel', + region : 'center', + xns : Roo, + '|xns' : 'Roo', + items : [ + { + xtype : 'Form', + method : 'POST', + style : 'margin:10px;', + url : baseURL + '/Roo/Projects.php', + listeners : { + actioncomplete : function(_self,action) + { + if (action.type == 'setdata') { + //_this.dialog.el.mask("Loading"); + //this.load({ method: 'GET', params: { '_id' : _this.data.id }}); + return; + } + if (action.type == 'load') { + _this.dialog.el.unmask(); + return; + } + if (action.type =='submit') { + + _this.dialog.el.unmask(); + _this.dialog.hide(); + + if (_this.callback) { + _this.callback.call(_this, _this.form.getValues()); + } + _this.form.reset(); + return; + } + }, + rendered : function (form) + { + _this.form= form; + } + }, + xns : Roo.form, + '|xns' : 'Roo.form', + items : [ + { + xtype : 'TextField', + fieldLabel : _this._strings['ca0dbad92a874b2f69b549293387925e'] /* Code */, + name : 'code', + width : 150, + xns : Roo.form, + '|xns' : 'Roo.form' + }, + { + xtype : 'TextField', + fieldLabel : _this._strings['8e3a42158ee70b67cf55b33e2789a9e5'] /* Project Name */, + name : 'name', + qtip : _this._strings['d1847fa47ea6bc047b413947463262ab'] /* Enter Project Name */, + width : 300, + xns : Roo.form, + '|xns' : 'Roo.form' + }, + { + xtype : 'ComboBox', + allowBlank : false, + displayField : 'desc', + editable : false, + emptyText : _this._strings['b5b20a9df20ea61c1cc0485f5e83891e'] /* Select Project Type */, + fieldLabel : _this._strings['245fe794333c2b0d5c513129b346b93f'] /* Project Type */, + forceSelection : true, + hiddenName : 'type', + listWidth : 400, + loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */, + minChars : 2, + name : 'type_desc', + pageSize : 20, + qtip : _this._strings['b5b20a9df20ea61c1cc0485f5e83891e'] /* Select Project Type */, + queryParam : 'query[name]', + selectOnFocus : true, + tpl : '
{desc}
', + triggerAction : 'all', + typeAhead : true, + valueField : 'code', + width : 200, + xns : Roo.form, + '|xns' : 'Roo.form', + store : { + xtype : 'SimpleStore', + data : [ [ 'U' , "Project (Unconfirmed)" ], + [ 'P' , "Project" ], + [ 'C' , "Project (Closed)" ], + [ 'N' , "Non-Project" ], + [ 'X' , "Non-Project (Closed)" ] + ], + fields : [ 'code', 'desc' ], + xns : Roo.data, + '|xns' : 'Roo.data' + } + }, + { + xtype : 'ComboBox', + allowBlank : false, + displayField : 'name', + editable : false, + emptyText : _this._strings['99b344c8ae43e3e7213862b8f35c4e51'] /* Select Company */, + fieldLabel : _this._strings['577d7068826de925ea2aec01dbadf5e4'] /* Client */, + forceSelection : true, + hiddenName : 'client_id', + listWidth : 400, + loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */, + minChars : 2, + name : 'client_id_name', + pageSize : 20, + qtip : _this._strings['9675747b5ab12d05f18518761e68a533'] /* Select Companies */, + queryParam : 'query[name]', + selectOnFocus : true, + tpl : '
{name}
', + triggerAction : 'all', + typeAhead : true, + valueField : 'id', + width : 300, + listeners : { + add : function (combo) + { + Pman.Dialog.Companies.show( { id: 0 }, function(data) { + _this.form.setValues({ + client_id : data.id, + client_id_name : data.name + }); + }); + } + }, + xns : Roo.form, + '|xns' : 'Roo.form', + store : { + xtype : 'Store', + remoteSort : true, + sortInfo : { direction : 'ASC', field: 'name' }, + listeners : { + beforeload : function (_self, o){ + o.params = o.params || {}; + + o.params.type = 1; + o.params['query[group_pulldown]'] = 1; + } + }, + xns : Roo.data, + '|xns' : 'Roo.data', + proxy : { + xtype : 'HttpProxy', + method : 'GET', + url : baseURL + '/Roo/core_company', + xns : Roo.data, + '|xns' : 'Roo.data' + }, + reader : { + xtype : 'JsonReader', + fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data' + } + } + }, + { + xtype : 'ComboBox', + allowBlank : false, + displayField : 'name', + editable : false, + emptyText : _this._strings['ab83ccde6764ca581702f38d79834615'] /* Select Team */, + fieldLabel : _this._strings['ac848fa228f49ba2b8a5fbd76596817d'] /* Team */, + forceSelection : true, + hiddenName : 'team_id', + listWidth : 400, + loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */, + minChars : 2, + name : 'team_id_name', + pageSize : 20, + qtip : _this._strings['ab83ccde6764ca581702f38d79834615'] /* Select Team */, + queryParam : 'query[name]', + selectOnFocus : true, + tpl : '
{name}
', + triggerAction : 'all', + typeAhead : true, + valueField : 'id', + width : 300, + xns : Roo.form, + '|xns' : 'Roo.form', + store : { + xtype : 'Store', + remoteSort : true, + sortInfo : { direction : 'ASC', field: 'id' }, + listeners : { + beforeload : function (_self, o){ + o.params = o.params || {}; + // set more here + } + }, + xns : Roo.data, + '|xns' : 'Roo.data', + proxy : { + xtype : 'HttpProxy', + method : 'GET', + url : baseURL + '/Roo/Groups.php', + xns : Roo.data, + '|xns' : 'Roo.data' + }, + reader : { + xtype : 'JsonReader', + fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data' + } + } + }, + { + xtype : 'TextField', + fieldLabel : _this._strings['24f9e53eb92c0995d04433c1f7a4c9c0'] /* File location */, + name : 'file_location', + width : 300, + xns : Roo.form, + '|xns' : 'Roo.form' + }, + { + xtype : 'TextArea', + fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */, + height : 100, + name : 'remarks', + width : 300, + xns : Roo.form, + '|xns' : 'Roo.form' + }, + { + xtype : 'FieldSet', + legend : _this._strings['1a11b1adc359c03db0ca798a00e2632c'] /* Opened */, + xns : Roo.form, + '|xns' : 'Roo.form', + items : [ + { + xtype : 'DateField', + altFormats : 'Y-m-d|d/m/Y', + fieldLabel : _this._strings['ca528d836417871a349312db705a1951'] /* Open date */, + format : 'd/m/Y', + name : 'open_date', + width : 100, + xns : Roo.form, + '|xns' : 'Roo.form' + }, + { + xtype : 'ComboBox', + allowBlank : false, + displayField : 'name', + editable : false, + emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */, + fieldLabel : _this._strings['223aad18ce30620a724d8a97021ce26e'] /* Open by */, + forceSelection : true, + hiddenName : 'open_by', + listWidth : 400, + loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */, + minChars : 2, + name : 'open_by_name', + pageSize : 20, + qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */, + queryParam : 'query[name]', + selectOnFocus : true, + tpl : '
{name}
', + triggerAction : 'all', + typeAhead : true, + valueField : 'id', + width : 300, + xns : Roo.form, + '|xns' : 'Roo.form', + store : { + xtype : 'Store', + remoteSort : true, + sortInfo : { direction : 'ASC', field: 'id' }, + listeners : { + beforeload : function (_self, o){ + o.params = o.params || {}; + // set more here + } + }, + xns : Roo.data, + '|xns' : 'Roo.data', + proxy : { + xtype : 'HttpProxy', + method : 'GET', + url : baseURL + '/Roo/Person.php', + xns : Roo.data, + '|xns' : 'Roo.data' + }, + reader : { + xtype : 'JsonReader', + fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data' + } + } + } + ] + }, + { + xtype : 'Hidden', + name : 'id', + xns : Roo.form, + '|xns' : 'Roo.form' + } + ] + } + ] + } + ] + }); + } };