From dcda88839cc0d92982a26110750c04c0099822ee Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 25 Jun 2015 16:27:47 +0800 Subject: [PATCH] Pman.Tab.AdminCompanies.bjs Pman.Tab.AdminCompanies.js --- Pman.Tab.AdminCompanies.bjs | 514 ++++++++------- Pman.Tab.AdminCompanies.js | 1240 +++++++++++++++++------------------ 2 files changed, 885 insertions(+), 869 deletions(-) diff --git a/Pman.Tab.AdminCompanies.bjs b/Pman.Tab.AdminCompanies.bjs index 658d432..8a567bd 100644 --- a/Pman.Tab.AdminCompanies.bjs +++ b/Pman.Tab.AdminCompanies.bjs @@ -1,253 +1,269 @@ { - "name" : "Pman.Tab.AdminCompanies", - "parent" : "Pman.Tab.Admin", - "title" : "Pman.Tab.AdminCompanies", - "path" : "/home/michael/gitlive/Pman.Admin/Pman.Tab.AdminCompanies.bjs", - "permname" : "Admin.Companies", - "modOrder" : "030", - "items" : [ + "name" : "Pman.Tab.AdminCompanies", + "parent" : "Pman.Tab.Admin", + "title" : "Pman.Tab.AdminCompanies", + "path" : "/home/edward/gitlive/Pman.Admin/Pman.Tab.AdminCompanies.bjs", + "permname" : "Admin.Companies", + "modOrder" : "030", + "strings" : { + "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email", + "231bc72756b5e6de492aaaa1577f61b1" : "Remarks", + "edefbda3a2bdd979e42d8944b7325b79" : "Companies", + "ec211f7c20af43e742bf2570c3cb84f9" : "Add", + "fc6f97505d89fe9277965c126744647a" : "No Companies found", + "7dce122004969d56ae2e0245cb754d35" : "Edit", + "155ca6a755e25c15ad7ce45e2f638f10" : "Displaying Companies{0} - {1} of {2}", + "f2a6c498fb90ee345d997f888fce3b18" : "Delete", + "a1fa27779242b4902f7ae3bdd5c6d508" : "Type", + "9c9745a343efeacc9efe9b7222b27afb" : "Ref#", + "49ee3087348e8d44e1feda1917443987" : "Name", + "2e006b735fbd916d8ab26978ae6714d4" : "Tel", + "dd7bf230fde8d4836917806aff6a6b27" : "Address", + "9810aa2b9f44401be4bf73188ef2b67d" : "Fax" + }, + "items" : [ + { + "region" : "center", + "title" : "Companies", + "xtype" : "NestedLayoutPanel", + "$ xns" : "Roo", + "items" : [ + { + "xtype" : "BorderLayout", + "$ xns" : "Roo", + "* prop" : "layout", + "items" : [ + { + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "* prop" : "center" + }, + { + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "split" : true, + "* prop" : "south", + "height" : 150, + "titlebar" : true + }, + { + "listeners" : { + "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + }, + "region" : "center", + "fitToframe" : true, + "background" : true, + "title" : "Companies", + "xtype" : "GridPanel", + "fitContainer" : true, + "$ xns" : "Roo", + "tableName" : "Companies", + "items" : [ { - "region" : "center", - "xtype" : "NestedLayoutPanel", - "title" : "Companies", - "$ xns" : "Roo", - "items" : [ - { - "xtype" : "BorderLayout", - "$ xns" : "Roo", - "* prop" : "layout", - "items" : [ - { - "xtype" : "LayoutRegion", - "$ xns" : "Roo", - "* prop" : "center" - }, - { - "xtype" : "LayoutRegion", - "$ xns" : "Roo", - "split" : true, - "* prop" : "south", - "height" : 150, - "titlebar" : true - }, - { - "listeners" : { - "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" - }, - "fitToframe" : true, - "background" : true, - "region" : "center", - "title" : "Companies", - "xtype" : "GridPanel", - "fitContainer" : true, - "$ xns" : "Roo", - "tableName" : "Companies", - "items" : [ - { - "listeners" : { - "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n \n}\n", - "|render" : "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.Companies;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", - "rowclick" : "function (_self, rowIndex, e)\n{\n try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {}\n}" - }, - "autoExpandColumn" : "name", - "xtype" : "Grid", - "loadMask" : true, - "$ xns" : "Roo.grid", - "* prop" : "grid", - "items" : [ - { - "listeners" : { - "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n try {\n o.params['query[name]'] = _this.searchBox.getValue();\n } catch(e) { return false; }\n}", - "load" : "function (_self, records, options)\n{\n try {\n Pman.Tab.AdminOffice.grid.footer.onClick('refresh');\n } catch (e) {}\n}" - }, - "xtype" : "Store", - "remoteSort" : true, - "$ sortInfo" : "{ field : 'name', direction: 'ASC' }", - "$ xns" : "Roo.data", - "* prop" : "dataSource", - "items" : [ - { - "listeners" : { - "load" : "function (This, o, arg)\n{\n \n}" - }, - "$ url" : "baseURL + '/Roo/Companies.php'", - "xtype" : "HttpProxy", - "method" : "GET", - "$ xns" : "Roo.data", - "* prop" : "proxy" - }, - { - "id" : "id", - "root" : "data", - "xtype" : "JsonReader", - "$ xns" : "Roo.data", - "$ fields" : "[\n {\n 'name': 'code',\n 'type': 'string'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'address',\n 'type': 'string'\n },\n {\n 'name': 'tel',\n 'type': 'string'\n },\n {\n 'name': 'fax',\n 'type': 'string'\n },\n {\n 'name': 'email',\n 'type': 'string'\n },\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'isOwner',\n 'type': 'int'\n },\n {\n 'name': 'logo_id',\n 'type': 'int'\n },\n {\n 'name': 'background_color',\n 'type': 'string'\n },\n {\n 'name': 'comptype',\n 'type': 'string'\n },\n {\n 'name': 'url',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'created_by',\n 'type': 'int'\n },\n {\n 'name': 'created_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'updated_by',\n 'type': 'int'\n },\n {\n 'name': 'updated_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'passwd',\n 'type': 'string'\n },\n {\n 'name': 'dispatch_port',\n 'type': 'string'\n },\n {\n 'name': 'province',\n 'type': 'string'\n },\n {\n 'name': 'country',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_id',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_filename',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_ontable',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_onid',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_mimetype',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_width',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_height',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_filesize',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_displayorder',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_language',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_parent_image_id',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_created',\n 'type': 'date'\n },\n {\n 'name': 'logo_id_imgtype',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_linkurl',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_descript',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_title',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_name',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_email',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_role',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_active',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'main_office_id_id',\n 'type': 'int'\n },\n {\n 'name': 'main_office_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'main_office_id_name',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_address',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_email',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_role',\n 'type': 'string'\n }\n]", - "* prop" : "reader", - "totalProperty" : "total" - } - ] - }, - { - "pageSize" : 25, - "xtype" : "PagingToolbar", - "emptyMsg" : "No Companies found", - "$ xns" : "Roo", - "displayInfo" : true, - "displayMsg" : "Displaying Companies{0} - {1} of {2}", - "* prop" : "footer" - }, - { - "xtype" : "Toolbar", - "$ xns" : "Roo", - "* prop" : "toolbar", - "items" : [ - { - "listeners" : { - "specialkey" : "function (_self, e)\n{\n if (e.getKey() == 13) {\n _this.grid.footer.onClick( 'first' );\n }\n}", - "show" : "function (_self)\n{\n\n}", - "render" : "function (_self)\n{\n_this.searchBox = _self;\n}" - }, - "xtype" : "TextField", - "$ xns" : "Roo.form" - }, - { - "listeners" : { - "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}" - }, - "xtype" : "Button", - "cls" : "x-btn-icon", - "$ icon" : "rootURL + '/Pman/templates/images/search.gif'", - "$ xns" : "Roo.Toolbar" - }, - { - "listeners" : { - "|click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\n _this.grid.footer.onClick('first');\n}" - }, - "xtype" : "Button", - "cls" : "x-btn-icon", - "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'", - "$ xns" : "Roo.Toolbar" - }, - { - "xtype" : "Fill", - "$ xns" : "Roo.Toolbar" - }, - { - "listeners" : { - "|click" : "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" - }, - "text" : "Add", - "xtype" : "Button", - "cls" : "x-btn-text-icon", - "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", - "$ xns" : "Roo.Toolbar" - }, - { - "listeners" : { - "|click" : "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (!_this.dialog) return;\n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n" - }, - "text" : "Edit", - "xtype" : "Button", - "cls" : "x-btn-text-icon", - "$ icon" : "Roo.rootURL + 'images/default/tree/leaf.gif'", - "$ xns" : "Roo.Toolbar" - }, - { - "listeners" : { - "|click" : "function()\n{\n Pman.genericDelete(_this, 'Companies'); \n}\n " - }, - "text" : "Delete", - "xtype" : "Button", - "cls" : "x-btn-text-icon", - "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", - "$ xns" : "Roo.Toolbar" - } - ] - }, - { - "xtype" : "ColumnModel", - "sortable" : true, - "header" : "Type", - "width" : 90, - "$ renderer" : "function (v,x ,r) {\n //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n return v;\n}", - "$ xns" : "Roo.grid", - "* prop" : "colModel[]", - "dataIndex" : "comptype" - }, - { - "xtype" : "ColumnModel", - "sortable" : true, - "header" : "Ref#", - "width" : 50, - "$ renderer" : "function(v) { return String.format('{0}', v); }", - "$ xns" : "Roo.grid", - "* prop" : "colModel[]", - "dataIndex" : "code" - }, - { - "xtype" : "ColumnModel", - "sortable" : true, - "header" : "Name", - "width" : 200, - "$ renderer" : "function(v,x,r) {\n return String.format(r.data.comptype == 'OWNER' ? '{0}' : '{0}',v); \n}", - "$ xns" : "Roo.grid", - "* prop" : "colModel[]", - "dataIndex" : "name" - }, - { - "xtype" : "ColumnModel", - "header" : "Tel", - "width" : 100, - "$ renderer" : "function(v) { return String.format('{0}', v); }", - "$ xns" : "Roo.grid", - "* prop" : "colModel[]", - "dataIndex" : "tel" - }, - { - "xtype" : "ColumnModel", - "header" : "Fax", - "width" : 100, - "$ renderer" : "function(v) { return String.format('{0}', v); }", - "$ xns" : "Roo.grid", - "* prop" : "colModel[]", - "dataIndex" : "fax" - }, - { - "xtype" : "ColumnModel", - "sortable" : true, - "header" : "Email", - "width" : 100, - "$ renderer" : " function (v) {\n return (v.length && v.indexOf('@') > 0 ) ? \n String.format('{0}',v) : v;\n \n }", - "$ xns" : "Roo.grid", - "* prop" : "colModel[]", - "dataIndex" : "email" - }, - { - "xtype" : "ColumnModel", - "sortable" : true, - "header" : "Address", - "width" : 200, - "$ renderer" : "function(v) { return String.format('{0}', v); }", - "$ xns" : "Roo.grid", - "* prop" : "colModel[]", - "dataIndex" : "address" - }, - { - "xtype" : "ColumnModel", - "width" : 200, - "header" : "Remarks", - "$ renderer" : "function(v) { return String.format('{0}', v); }", - "$ xns" : "Roo.grid", - "* prop" : "colModel[]", - "dataIndex" : "remarks" - } - ] - } - ] - } - ] - } - ] + "listeners" : { + "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n \n}\n", + "|render" : "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.Companies;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", + "rowclick" : "function (_self, rowIndex, e)\n{\n try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {}\n}" + }, + "autoExpandColumn" : "name", + "xtype" : "Grid", + "loadMask" : true, + "$ xns" : "Roo.grid", + "* prop" : "grid", + "items" : [ + { + "listeners" : { + "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n try {\n o.params['query[name]'] = _this.searchBox.getValue();\n } catch(e) { return false; }\n}", + "load" : "function (_self, records, options)\n{\n try {\n Pman.Tab.AdminOffice.grid.footer.onClick('refresh');\n } catch (e) {}\n}" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ field : 'name', direction: 'ASC' }", + "$ xns" : "Roo.data", + "* prop" : "dataSource", + "items" : [ + { + "listeners" : { + "load" : "function (This, o, arg)\n{\n \n}" + }, + "$ url" : "baseURL + '/Roo/Companies.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[\n {\n 'name': 'code',\n 'type': 'string'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'address',\n 'type': 'string'\n },\n {\n 'name': 'tel',\n 'type': 'string'\n },\n {\n 'name': 'fax',\n 'type': 'string'\n },\n {\n 'name': 'email',\n 'type': 'string'\n },\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'isOwner',\n 'type': 'int'\n },\n {\n 'name': 'logo_id',\n 'type': 'int'\n },\n {\n 'name': 'background_color',\n 'type': 'string'\n },\n {\n 'name': 'comptype',\n 'type': 'string'\n },\n {\n 'name': 'url',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'created_by',\n 'type': 'int'\n },\n {\n 'name': 'created_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'updated_by',\n 'type': 'int'\n },\n {\n 'name': 'updated_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'passwd',\n 'type': 'string'\n },\n {\n 'name': 'dispatch_port',\n 'type': 'string'\n },\n {\n 'name': 'province',\n 'type': 'string'\n },\n {\n 'name': 'country',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_id',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_filename',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_ontable',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_onid',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_mimetype',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_width',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_height',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_filesize',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_displayorder',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_language',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_parent_image_id',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_created',\n 'type': 'date'\n },\n {\n 'name': 'logo_id_imgtype',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_linkurl',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_descript',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_title',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_name',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_email',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_role',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_active',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'main_office_id_id',\n 'type': 'int'\n },\n {\n 'name': 'main_office_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'main_office_id_name',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_address',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_email',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_role',\n 'type': 'string'\n }\n]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + }, + { + "pageSize" : 25, + "xtype" : "PagingToolbar", + "emptyMsg" : "No Companies found", + "$ xns" : "Roo", + "displayInfo" : true, + "displayMsg" : "Displaying Companies{0} - {1} of {2}", + "* prop" : "footer" + }, + { + "xtype" : "Toolbar", + "$ xns" : "Roo", + "* prop" : "toolbar", + "items" : [ + { + "listeners" : { + "specialkey" : "function (_self, e)\n{\n if (e.getKey() == 13) {\n _this.grid.footer.onClick( 'first' );\n }\n}", + "show" : "function (_self)\n{\n\n}", + "render" : "function (_self)\n{\n_this.searchBox = _self;\n}" + }, + "xtype" : "TextField", + "$ xns" : "Roo.form" + }, + { + "listeners" : { + "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}" + }, + "xtype" : "Button", + "cls" : "x-btn-icon", + "$ icon" : "rootURL + '/Pman/templates/images/search.gif'", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "|click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\n _this.grid.footer.onClick('first');\n}" + }, + "xtype" : "Button", + "cls" : "x-btn-icon", + "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'", + "$ xns" : "Roo.Toolbar" + }, + { + "xtype" : "Fill", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "|click" : "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" + }, + "text" : "Add", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "|click" : "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (!_this.dialog) return;\n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n" + }, + "text" : "Edit", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "Roo.rootURL + 'images/default/tree/leaf.gif'", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "|click" : "function()\n{\n Pman.genericDelete(_this, 'Companies'); \n}\n " + }, + "text" : "Delete", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", + "$ xns" : "Roo.Toolbar" + } + ] + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Type", + "width" : 90, + "$ renderer" : "function (v,x ,r) {\n //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n return v;\n}", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "comptype" + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Ref#", + "width" : 50, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "code" + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Name", + "width" : 200, + "$ renderer" : "function(v,x,r) {\n return String.format(r.data.comptype == 'OWNER' ? '{0}' : '{0}',v); \n}", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "name" + }, + { + "xtype" : "ColumnModel", + "width" : 100, + "header" : "Tel", + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "tel" + }, + { + "xtype" : "ColumnModel", + "width" : 100, + "header" : "Fax", + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "fax" + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Email", + "width" : 100, + "$ renderer" : " function (v) {\n return (v.length && v.indexOf('@') > 0 ) ? \n String.format('{0}',v) : v;\n \n }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "email" + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Address", + "width" : 200, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "address" + }, + { + "xtype" : "ColumnModel", + "header" : "Remarks", + "width" : 200, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "remarks" + } + ] } - ] + ] + } + ] + } + ] + } + ] } \ No newline at end of file diff --git a/Pman.Tab.AdminCompanies.js b/Pman.Tab.AdminCompanies.js index 4a7f533..37f129b 100644 --- a/Pman.Tab.AdminCompanies.js +++ b/Pman.Tab.AdminCompanies.js @@ -5,627 +5,627 @@ Roo.namespace('Pman.Tab'); Pman.Tab.AdminCompanies = new Roo.XComponent({ - part : ["Admin", "Companies" ], - order : '030-Pman.Tab.AdminCompanies', - region : 'center', - parent : 'Pman.Tab.Admin', - name : "Pman.Tab.AdminCompanies", - disabled : false, - permname : 'Admin.Companies', - _tree : function() - { - var _this = this; - var MODULE = this; - return { - layout : { - center : { - '|xns' : 'Roo', - xtype : 'LayoutRegion', - xns : Roo - }, - south : { - '|xns' : 'Roo', - xtype : 'LayoutRegion', - xns : Roo, - split : true, - height : 150, - titlebar : true - }, - '|xns' : 'Roo', - xtype : 'BorderLayout', - xns : Roo, - items : [ - { - grid : { - dataSource : { - proxy : { - '|xns' : 'Roo.data', - url : baseURL + '/Roo/Companies.php', - xtype : 'HttpProxy', - method : 'GET', - xns : Roo.data, - listeners : { - load : function (This, o, arg) - { - - } - } - }, - reader : { - '|xns' : 'Roo.data', - id : 'id', - root : 'data', - xtype : 'JsonReader', - xns : Roo.data, - fields : [ - { - 'name': 'code', - 'type': 'string' - }, - { - 'name': 'name', - 'type': 'string' - }, - { - 'name': 'remarks', - 'type': 'string' - }, - { - 'name': 'owner_id', - 'type': 'int' - }, - { - 'name': 'address', - 'type': 'string' - }, - { - 'name': 'tel', - 'type': 'string' - }, - { - 'name': 'fax', - 'type': 'string' - }, - { - 'name': 'email', - 'type': 'string' - }, - { - 'name': 'id', - 'type': 'int' - }, - { - 'name': 'isOwner', - 'type': 'int' - }, - { - 'name': 'logo_id', - 'type': 'int' - }, - { - 'name': 'background_color', - 'type': 'string' - }, - { - 'name': 'comptype', - 'type': 'string' - }, - { - 'name': 'url', - 'type': 'string' - }, - { - 'name': 'main_office_id', - 'type': 'int' - }, - { - 'name': 'created_by', - 'type': 'int' - }, - { - 'name': 'created_dt', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'updated_by', - 'type': 'int' - }, - { - 'name': 'updated_dt', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'passwd', - 'type': 'string' - }, - { - 'name': 'dispatch_port', - 'type': 'string' - }, - { - 'name': 'province', - 'type': 'string' - }, - { - 'name': 'country', - 'type': 'string' - }, - { - 'name': 'logo_id_id', - 'type': 'int' - }, - { - 'name': 'logo_id_filename', - 'type': 'string' - }, - { - 'name': 'logo_id_ontable', - 'type': 'string' - }, - { - 'name': 'logo_id_onid', - 'type': 'int' - }, - { - 'name': 'logo_id_mimetype', - 'type': 'string' - }, - { - 'name': 'logo_id_width', - 'type': 'int' - }, - { - 'name': 'logo_id_height', - 'type': 'int' - }, - { - 'name': 'logo_id_filesize', - 'type': 'int' - }, - { - 'name': 'logo_id_displayorder', - 'type': 'int' - }, - { - 'name': 'logo_id_language', - 'type': 'string' - }, - { - 'name': 'logo_id_parent_image_id', - 'type': 'int' - }, - { - 'name': 'logo_id_created', - 'type': 'date' - }, - { - 'name': 'logo_id_imgtype', - 'type': 'string' - }, - { - 'name': 'logo_id_linkurl', - 'type': 'string' - }, - { - 'name': 'logo_id_descript', - 'type': 'string' - }, - { - 'name': 'logo_id_title', - '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': 'main_office_id_id', - 'type': 'int' - }, - { - 'name': 'main_office_id_company_id', - 'type': 'int' - }, - { - 'name': 'main_office_id_name', - 'type': 'string' - }, - { - 'name': 'main_office_id_address', - 'type': 'string' - }, - { - 'name': 'main_office_id_phone', - 'type': 'string' - }, - { - 'name': 'main_office_id_fax', - 'type': 'string' - }, - { - 'name': 'main_office_id_email', - 'type': 'string' - }, - { - 'name': 'main_office_id_role', - 'type': 'string' - } - ], - totalProperty : 'total' - }, - '|xns' : 'Roo.data', - xtype : 'Store', - remoteSort : true, - sortInfo : { field : 'name', direction: 'ASC' }, - xns : Roo.data, - listeners : { - beforeload : function (_self, o) - { - o.params = o.params || {}; - try { - o.params['query[name]'] = _this.searchBox.getValue(); - } catch(e) { return false; } - }, - load : function (_self, records, options) - { - try { - Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); - } catch (e) {} - } - }, - items : [ - ] - - }, - footer : { - '|xns' : 'Roo', - pageSize : 25, - xtype : 'PagingToolbar', - emptyMsg : "No Companies found", - xns : Roo, - displayInfo : true, - displayMsg : "Displaying Companies{0} - {1} of {2}" - }, - toolbar : { - '|xns' : 'Roo', - xtype : 'Toolbar', - xns : Roo, - items : [ - { - '|xns' : 'Roo.form', - xtype : 'TextField', - xns : Roo.form, - listeners : { - specialkey : function (_self, e) - { - if (e.getKey() == 13) { - _this.grid.footer.onClick( 'first' ); - } - }, - show : function (_self) - { - - }, - render : function (_self) - { - _this.searchBox = _self; - } - } - }, - { - '|xns' : 'Roo.Toolbar', - xtype : 'Button', - cls : 'x-btn-icon', - icon : rootURL + '/Pman/templates/images/search.gif', - xns : Roo.Toolbar, - listeners : { - click : function (_self, e) - { - _this.grid.footer.onClick('first'); - } - } - }, - { - '|xns' : 'Roo.Toolbar', - xtype : 'Button', - cls : 'x-btn-icon', - icon : rootURL + '/Pman/templates/images/edit-clear.gif', - xns : Roo.Toolbar, - listeners : { - click : function (_self, e) - { - _this.searchBox.setValue(''); - _this.grid.footer.onClick('first'); - } - } - }, - { - '|xns' : 'Roo.Toolbar', - xtype : 'Fill', - xns : Roo.Toolbar - }, - { - '|xns' : 'Roo.Toolbar', - text : "Add", - xtype : 'Button', - cls : 'x-btn-text-icon', - icon : Roo.rootURL + 'images/default/dd/drop-add.gif', - xns : Roo.Toolbar, - listeners : { - click : function() - { - if (!_this.dialog) return; - _this.dialog.show( { id : 0 } , function() { - _this.grid.footer.onClick('first'); - }); - } - } - }, - { - '|xns' : 'Roo.Toolbar', - text : "Edit", - xtype : 'Button', - cls : 'x-btn-text-icon', - icon : Roo.rootURL + 'images/default/tree/leaf.gif', - xns : Roo.Toolbar, - 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'); - }); - - } - } - }, - { - '|xns' : 'Roo.Toolbar', - text : "Delete", - xtype : 'Button', - cls : 'x-btn-text-icon', - icon : rootURL + '/Pman/templates/images/trash.gif', - xns : Roo.Toolbar, - listeners : { - click : function() - { - Pman.genericDelete(_this, 'Companies'); - } - } - } - ] - - }, - '|xns' : 'Roo.grid', - autoExpandColumn : 'name', - xtype : 'Grid', - loadMask : true, - xns : Roo.grid, - colModel : [ - { - '|xns' : 'Roo.grid', - xtype : 'ColumnModel', - sortable : true, - header : 'Type', - width : 90, - renderer : function (v,x ,r) { - //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v); - return v; - }, - xns : Roo.grid, - dataIndex : 'comptype' - }, -{ - '|xns' : 'Roo.grid', - xtype : 'ColumnModel', - sortable : true, - header : 'Ref#', - width : 50, - renderer : function(v) { return String.format('{0}', v); }, - xns : Roo.grid, - dataIndex : 'code' - }, -{ - '|xns' : 'Roo.grid', - xtype : 'ColumnModel', - sortable : true, - header : 'Name', - width : 200, - renderer : function(v,x,r) { - return String.format(r.data.comptype == 'OWNER' ? '{0}' : '{0}',v); - }, - xns : Roo.grid, - dataIndex : 'name' - }, -{ - '|xns' : 'Roo.grid', - xtype : 'ColumnModel', - header : 'Tel', - width : 100, - renderer : function(v) { return String.format('{0}', v); }, - xns : Roo.grid, - dataIndex : 'tel' - }, -{ - '|xns' : 'Roo.grid', - xtype : 'ColumnModel', - header : 'Fax', - width : 100, - renderer : function(v) { return String.format('{0}', v); }, - xns : Roo.grid, - dataIndex : 'fax' - }, -{ - '|xns' : 'Roo.grid', - xtype : 'ColumnModel', - sortable : true, - header : 'Email', - width : 100, - renderer : function (v) { - return (v.length && v.indexOf('@') > 0 ) ? - String.format('{0}',v) : v; - - }, - xns : Roo.grid, - dataIndex : 'email' - }, -{ - '|xns' : 'Roo.grid', - xtype : 'ColumnModel', - sortable : true, - header : 'Address', - width : 200, - renderer : function(v) { return String.format('{0}', v); }, - xns : Roo.grid, - dataIndex : 'address' - }, -{ - '|xns' : 'Roo.grid', - xtype : 'ColumnModel', - width : 200, - header : 'Remarks', - renderer : function(v) { return String.format('{0}', v); }, - xns : Roo.grid, - dataIndex : 'remarks' - } - ], - listeners : { - rowdblclick : function (_self, rowIndex, e) - { - if (!_this.dialog) return; - _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() { - _this.grid.footer.onClick('first'); - }); - - - }, - render : function() - { - _this.grid = this; - _this.dialog = Pman.Dialog.Companies; - if (_this.panel.active) { - this.footer.onClick('first'); - } - }, - rowclick : function (_self, rowIndex, e) - { - try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {} - } - }, - items : [ - - ] - - }, - '|xns' : 'Roo', - fitToframe : true, - background : true, - region : 'center', - title : "Companies", - xtype : 'GridPanel', - fitContainer : true, - xns : Roo, - tableName : 'Companies', - listeners : { - activate : function() { - _this.panel = this; - if (_this.grid) { - _this.grid.footer.onClick('first'); - } - } - }, - items : [ - - ] - - } - ] + _strings : { + 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email", + '231bc72756b5e6de492aaaa1577f61b1' :"Remarks", + 'edefbda3a2bdd979e42d8944b7325b79' :"Companies", + 'ec211f7c20af43e742bf2570c3cb84f9' :"Add", + 'fc6f97505d89fe9277965c126744647a' :"No Companies found", + '7dce122004969d56ae2e0245cb754d35' :"Edit", + '155ca6a755e25c15ad7ce45e2f638f10' :"Displaying Companies{0} - {1} of {2}", + 'f2a6c498fb90ee345d997f888fce3b18' :"Delete", + 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type", + '9c9745a343efeacc9efe9b7222b27afb' :"Ref#", + '49ee3087348e8d44e1feda1917443987' :"Name", + '2e006b735fbd916d8ab26978ae6714d4' :"Tel", + 'dd7bf230fde8d4836917806aff6a6b27' :"Address", + '9810aa2b9f44401be4bf73188ef2b67d' :"Fax" + }, + part : ["Admin", "Companies" ], + order : '030-Pman.Tab.AdminCompanies', + region : 'center', + parent : 'Pman.Tab.Admin', + name : "Pman.Tab.AdminCompanies", + disabled : false, + permname : 'Admin.Companies', + _tree : function() + { + var _this = this; + var MODULE = this; + return { + region : 'center', + title : _this._strings['edefbda3a2bdd979e42d8944b7325b79'] /* Companies */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'NestedLayoutPanel', + layout : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'BorderLayout', + center : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'LayoutRegion' + }, + south : { + height : 150, + split : true, + titlebar : true, + xns : Roo, + '|xns' : 'Roo', + xtype : 'LayoutRegion' + }, + items : [ + { + background : true, + fitContainer : true, + fitToframe : true, + region : 'center', + tableName : 'Companies', + title : _this._strings['edefbda3a2bdd979e42d8944b7325b79'] /* Companies */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'GridPanel', + listeners : { + activate : function() { + _this.panel = this; + if (_this.grid) { + _this.grid.footer.onClick('first'); + } + } + }, + grid : { + autoExpandColumn : 'name', + loadMask : true, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'Grid', + listeners : { + render : function() + { + _this.grid = this; + _this.dialog = Pman.Dialog.Companies; + if (_this.panel.active) { + this.footer.onClick('first'); + } + }, + rowclick : function (_self, rowIndex, e) + { + try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {} + }, + rowdblclick : function (_self, rowIndex, e) + { + if (!_this.dialog) return; + _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() { + _this.grid.footer.onClick('first'); + }); + + + } + }, + footer : { + displayInfo : true, + displayMsg : _this._strings['155ca6a755e25c15ad7ce45e2f638f10'] /* Displaying Companies{0} - {1} of {2} */, + emptyMsg : _this._strings['fc6f97505d89fe9277965c126744647a'] /* No Companies found */, + pageSize : 25, + xns : Roo, + '|xns' : 'Roo', + xtype : 'PagingToolbar' + }, + toolbar : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'Toolbar', + items : [ + { + xns : Roo.form, + '|xns' : 'Roo.form', + xtype : 'TextField', + listeners : { + render : function (_self) + { + _this.searchBox = _self; }, - '|xns' : 'Roo', - region : 'center', - xtype : 'NestedLayoutPanel', - title : "Companies", - xns : Roo, - items : [ - - ] - - }; } + show : function (_self) + { + + }, + specialkey : function (_self, e) + { + if (e.getKey() == 13) { + _this.grid.footer.onClick( 'first' ); + } + } + } + }, + { + cls : 'x-btn-icon', + icon : rootURL + '/Pman/templates/images/search.gif', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + click : function (_self, e) + { + _this.grid.footer.onClick('first'); + } + } + }, + { + cls : 'x-btn-icon', + icon : rootURL + '/Pman/templates/images/edit-clear.gif', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + click : function (_self, e) + { + _this.searchBox.setValue(''); + _this.grid.footer.onClick('first'); + } + } + }, + { + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Fill' + }, + { + cls : 'x-btn-text-icon', + icon : Roo.rootURL + 'images/default/dd/drop-add.gif', + text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */, + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + click : function() + { + if (!_this.dialog) return; + _this.dialog.show( { id : 0 } , function() { + _this.grid.footer.onClick('first'); + }); + } + } + }, + { + cls : 'x-btn-text-icon', + icon : Roo.rootURL + 'images/default/tree/leaf.gif', + text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */, + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + 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'); + }); + + } + } + }, + { + cls : 'x-btn-text-icon', + icon : rootURL + '/Pman/templates/images/trash.gif', + text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */, + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + click : function() + { + Pman.genericDelete(_this, 'Companies'); + } + } + } + ] + }, + dataSource : { + remoteSort : true, + sortInfo : { field : 'name', direction: 'ASC' }, + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'Store', + listeners : { + beforeload : function (_self, o) + { + o.params = o.params || {}; + try { + o.params['query[name]'] = _this.searchBox.getValue(); + } catch(e) { return false; } + }, + load : function (_self, records, options) + { + try { + Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); + } catch (e) {} + } + }, + proxy : { + method : 'GET', + url : baseURL + '/Roo/Companies.php', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'HttpProxy', + listeners : { + load : function (This, o, arg) + { + + } + } + }, + reader : { + fields : [ + { + 'name': 'code', + 'type': 'string' + }, + { + 'name': 'name', + 'type': 'string' + }, + { + 'name': 'remarks', + 'type': 'string' + }, + { + 'name': 'owner_id', + 'type': 'int' + }, + { + 'name': 'address', + 'type': 'string' + }, + { + 'name': 'tel', + 'type': 'string' + }, + { + 'name': 'fax', + 'type': 'string' + }, + { + 'name': 'email', + 'type': 'string' + }, + { + 'name': 'id', + 'type': 'int' + }, + { + 'name': 'isOwner', + 'type': 'int' + }, + { + 'name': 'logo_id', + 'type': 'int' + }, + { + 'name': 'background_color', + 'type': 'string' + }, + { + 'name': 'comptype', + 'type': 'string' + }, + { + 'name': 'url', + 'type': 'string' + }, + { + 'name': 'main_office_id', + 'type': 'int' + }, + { + 'name': 'created_by', + 'type': 'int' + }, + { + 'name': 'created_dt', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'updated_by', + 'type': 'int' + }, + { + 'name': 'updated_dt', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'passwd', + 'type': 'string' + }, + { + 'name': 'dispatch_port', + 'type': 'string' + }, + { + 'name': 'province', + 'type': 'string' + }, + { + 'name': 'country', + 'type': 'string' + }, + { + 'name': 'logo_id_id', + 'type': 'int' + }, + { + 'name': 'logo_id_filename', + 'type': 'string' + }, + { + 'name': 'logo_id_ontable', + 'type': 'string' + }, + { + 'name': 'logo_id_onid', + 'type': 'int' + }, + { + 'name': 'logo_id_mimetype', + 'type': 'string' + }, + { + 'name': 'logo_id_width', + 'type': 'int' + }, + { + 'name': 'logo_id_height', + 'type': 'int' + }, + { + 'name': 'logo_id_filesize', + 'type': 'int' + }, + { + 'name': 'logo_id_displayorder', + 'type': 'int' + }, + { + 'name': 'logo_id_language', + 'type': 'string' + }, + { + 'name': 'logo_id_parent_image_id', + 'type': 'int' + }, + { + 'name': 'logo_id_created', + 'type': 'date' + }, + { + 'name': 'logo_id_imgtype', + 'type': 'string' + }, + { + 'name': 'logo_id_linkurl', + 'type': 'string' + }, + { + 'name': 'logo_id_descript', + 'type': 'string' + }, + { + 'name': 'logo_id_title', + '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': 'main_office_id_id', + 'type': 'int' + }, + { + 'name': 'main_office_id_company_id', + 'type': 'int' + }, + { + 'name': 'main_office_id_name', + 'type': 'string' + }, + { + 'name': 'main_office_id_address', + 'type': 'string' + }, + { + 'name': 'main_office_id_phone', + 'type': 'string' + }, + { + 'name': 'main_office_id_fax', + 'type': 'string' + }, + { + 'name': 'main_office_id_email', + 'type': 'string' + }, + { + 'name': 'main_office_id_role', + 'type': 'string' + } + ], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'JsonReader' + } + }, + colModel : [ + { + dataIndex : 'comptype', + header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */, + renderer : function (v,x ,r) { + //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v); + return v; + }, + sortable : true, + width : 90, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'code', + header : _this._strings['9c9745a343efeacc9efe9b7222b27afb'] /* Ref# */, + renderer : function(v) { return String.format('{0}', v); }, + sortable : true, + width : 50, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'name', + header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */, + renderer : function(v,x,r) { + return String.format(r.data.comptype == 'OWNER' ? '{0}' : '{0}',v); + }, + sortable : true, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'tel', + header : _this._strings['2e006b735fbd916d8ab26978ae6714d4'] /* Tel */, + renderer : function(v) { return String.format('{0}', v); }, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'fax', + header : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */, + renderer : function(v) { return String.format('{0}', v); }, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'email', + header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */, + renderer : function (v) { + return (v.length && v.indexOf('@') > 0 ) ? + String.format('{0}',v) : v; + + }, + sortable : true, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'address', + header : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */, + renderer : function(v) { return String.format('{0}', v); }, + sortable : true, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'remarks', + header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */, + renderer : function(v) { return String.format('{0}', v); }, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + } + ] + } + } + ] + } + }; } }); -- 2.39.2