From fd21b52d6f33b67b96268da9603d09d7fdbdf145 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 25 May 2010 18:21:41 +0800 Subject: [PATCH] add bjs --- Pman.Tab.AdminLogEvents.bjs | 1 + Pman.Tab.AdminLogs.bjs | 1 + Pman.Tab.AdminProjects.bjs | 1 + Pman.Tab.AdminTranslations.bjs | 1 + 4 files changed, 4 insertions(+) create mode 100644 Pman.Tab.AdminLogEvents.bjs create mode 100644 Pman.Tab.AdminLogs.bjs create mode 100644 Pman.Tab.AdminProjects.bjs create mode 100644 Pman.Tab.AdminTranslations.bjs diff --git a/Pman.Tab.AdminLogEvents.bjs b/Pman.Tab.AdminLogEvents.bjs new file mode 100644 index 0000000..ec2869c --- /dev/null +++ b/Pman.Tab.AdminLogEvents.bjs @@ -0,0 +1 @@ +{"xtype":"*Module","app":"Admin","modkey":0,"|module":"Pman.Tab.AdminLogEvents","region":"center","|parent":"Pman.Tab.AdminLogs","name":"Pman.Tab.AdminLogEvents","listeners":{},"items":[{"xtype":"GridPanel","title":"Events","fitToframe":true,"fitContainer":true,"tableName":"Events","background":true,"listeners":{"|activate":"function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"},"items":[{"*prop":"grid","xtype":"Grid","autoExpandColumn":"remarks","loadMask":true,"listeners":{"|render":"function() { \n _this.grid = this; \n \/\/_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}"},"items":[{"*prop":"dataSource","xtype":"Store","|reader":"Pman.Readers.Events","listeners":{"|beforeload":"function (_self, o)\n{\n if (! _this.personSel) {\n return;\n }\n o.params = o.params || {};\n o.params.person_id = _this.personSel.getValue();\n \n}"},"remoteSort":true,"|sortInfo":"{ field: 'event_when', direction: 'DESC'}","items":[{"*prop":"proxy","xtype":"HttpProxy","method":"GET","|url":"baseURL + '\/Roo\/Events.php'","listeners":{}}]},{"*prop":"colModel","xtype":"Array","listeners":{},"items":[{"xtype":"*ColumnModel","header":"When","width":100,"dataIndex":"event_when","|renderer":"function(v) { return v ? v.dateFormat('d\/m\/Y H:i') : ''; }","listeners":{}},{"xtype":"*ColumnModel","header":"Staff","width":150,"dataIndex":"person_name","|renderer":"function(v) { return String.format('{0}', v); }","listeners":{}},{"xtype":"*ColumnModel","header":"Action","width":100,"dataIndex":"action","|renderer":"function(v) { return String.format('{0}', v); }"},{"xtype":"*ColumnModel","header":"IP","width":100,"dataIndex":"ipaddr","|renderer":"function(v) { return String.format('{0}', v); }","listeners":{}},{"xtype":"*ColumnModel","header":"Affected","width":100,"dataIndex":"on_id","|renderer":"function(v, x, r) { return v ? String.format('{0}({1})', r.data.on_table, v) : ''; }","listeners":{}},{"xtype":"*ColumnModel","header":"Remarks","width":300,"dataIndex":"remarks","|renderer":"function(v) { return String.format('{0}', v); }","listeners":{}}]},{"*prop":"footer","xtype":"PagingToolbar","pageSize":25,"displayInfo":true,"displayMsg":"Displaying Events {0} - {1} of {2}","emptyMsg":"No Events found"},{"*prop":"toolbar","xtype":"Toolbar","listeners":{},"items":[{"xtype":"TextItem","|xns":"Roo.Toolbar","text":"Show","listeners":{}},{"fieldLabel":"Person ","name":"person_id_name","qtip":"Select Person ","emptyText":"Select Person ","xtype":"ComboBox","selectOnFocus":true,"allowBlank":true,"width":150,"listWidth":400,"editable":false,"displayField":"name","valueField":"id","typeAhead":true,"forceSelection":true,"triggerAction":"all","tpl":"
{name}<\/b> <\/div>","queryParam":"query[name]","loadingText":"Searching...","minChars":2,"pageSize":20,"listeners":{"|select":"function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}","|render":"function (_self)\n{\n _this.personSel = _self;\n}"},"items":[{"*prop":"store","xtype":"Store","|reader":"Pman.Readers.Person","listeners":{"|beforeload":"function (_self, o)\n{\n o.params = o.params || {};\n o.company_id = Pman.Login.authUser.company_id;\n}"},"items":[{"*prop":"proxy","xtype":"HttpProxy","|url":"baseURL + '\/Roo\/Person.php'","method":"GET"}]}]}]}]}]}],"title":"Admin - Logs - Events"} \ No newline at end of file diff --git a/Pman.Tab.AdminLogs.bjs b/Pman.Tab.AdminLogs.bjs new file mode 100644 index 0000000..9f654a3 --- /dev/null +++ b/Pman.Tab.AdminLogs.bjs @@ -0,0 +1 @@ +{"xtype":"*Module","app":"Admin","modkey":901,"|module":"Pman.Tab.AdminLogs","region":"center","|parent":"Pman","name":"Pman.Tab.AdminLogs","listeners":{},"perm":"Admin_Tab","permtype":"S","items":[{"xtype":"NestedLayoutPanel","background":true,"fitToFrame":true,"region":"center","listeners":{},"title":"Logs","items":[{"*prop":"layout","xtype":"BorderLayout","items":[{"xtype":"*LayoutRegion","*prop":"center","titlebar":false,"listeners":{},"tabPosition":"top"}]}]}],"title":"Logs"} \ No newline at end of file diff --git a/Pman.Tab.AdminProjects.bjs b/Pman.Tab.AdminProjects.bjs new file mode 100644 index 0000000..344d5d4 --- /dev/null +++ b/Pman.Tab.AdminProjects.bjs @@ -0,0 +1 @@ +{"xtype":"*Module","app":"Admin","modkey":10,"|module":"Pman.Tab.AdminProjects","region":"center","|parent":"Pman.Tab.Admin","name":"Pman.Tab.AdminProjects","listeners":{},"perm":"Core.Projects_All","permtype":"E","items":[{"xtype":"GridPanel","title":"Projects","fitToframe":true,"fitContainer":true,"tableName":"Projects","background":true,"listeners":{"|activate":"function() {\n _this.panel = this;\n \n \n if (_this.grid && _this.grid.rendered) {\n _this.grid.footer.onClick('first');\n }\n}"},"items":[{"*prop":"grid","xtype":"Grid","autoExpandColumn":"remarks","loadMask":true,"listeners":{"|render":"function() { \n _this.grid = this; \n _this.dialog = Pman.Dialog.Projects;\n _this.filter = 'P,U';\n _this.getTypes = function()\n {\n return [\n [ 'U' , \"Project (Unconfirmed)\" ],\n [ 'P' , \"Project\" ],\n [ 'C' , \"Project (Closed)\" ],\n [ 'N' , \"Non-Project\" ],\n [ 'X' , \"Non-Project (Closed)\" ]\n \n ];\n };\n _this.typeToString = function(v)\n {\n var ar = this.getTypes();\n var ret = '';\n Roo.each(ar, function(a) {\n if (a[0] == v) {\n ret = a[1];\n return false;\n }\n });\n return ret;\n }\n _this.grid.footer.onClick('first');\n}","|rowdblclick":"function (g, ri, e)\n{\n\n _this.dialog.show(g.getDataSource().getAt(ri).data, function() {\n _self.footer.onClick('refresh');\n });\n}"},"items":[{"*prop":"dataSource","xtype":"Store","|reader":"Pman.Readers.Projects","listeners":{"|beforeload":"function (_self, o)\n{\n if (!_this.searchBox) {\n return false;\n } \n o.params = o.params ? o.params : {};\n o.params['query[project_search]'] = _this.searchBox.getValue();\n o.params['query[project_filter]'] = _this.filter;\n}"},"|sortInfo":"{field:'code', direction:'DESC'}","remoteSort":true,"items":[{"*prop":"proxy","xtype":"HttpProxy","method":"GET","|url":"baseURL + '\/Roo\/Projects.php'"}]},{"*prop":"colModel","xtype":"Array","items":[{"xtype":"*ColumnModel","header":"Type","width":70,"dataIndex":"type","|renderer":"function(v) {return _this.typeToString(v); }","listeners":{}},{"xtype":"*ColumnModel","header":"Code","width":90,"dataIndex":"code","|renderer":"function(v) { return String.format('{0}', v); }","listeners":{}},{"xtype":"*ColumnModel","header":"Project Name","width":300,"dataIndex":"name","|renderer":"function(v) { return String.format('{0}', v); }","listeners":{}},{"xtype":"*ColumnModel","header":"Client ","width":100,"dataIndex":"client_id_name","|renderer":"function(v) { return String.format('{0}', v); }","listeners":{}},{"xtype":"*ColumnModel","header":"Remarks","width":300,"dataIndex":"remarks","|renderer":"function(v) { return String.format('{0}', v); }","listeners":{}}]},{"*prop":"footer","xtype":"PagingToolbar","pageSize":25,"displayInfo":true,"displayMsg":"Displaying Projects {0} - {1} of {2}","emptyMsg":"No Projects found"},{"*prop":"toolbar","xtype":"Toolbar","listeners":{},"items":[{"text":"Add","xtype":"Button","cls":"x-btn-text-icon","|icon":"Roo.rootURL + 'images\/default\/dd\/drop-add.gif'","listeners":{"|click":"function()\n {\n _this.dialog.show( { id : 0 }, function() {\n _this.grid.footer.onClick('first');\n\n }); \n\n }\n "}},{"text":"Edit","xtype":"Button","cls":"x-btn-text-icon","|icon":"Roo.rootURL + 'images\/default\/tree\/leaf.gif'","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 Project\" : \"Select a Project\");\n return;\n }\n \n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n }\n "}},{"xtype":"Separator","|xns":"Roo.Toolbar","listeners":{}},{"xtype":"TextItem","|xns":"Roo.Toolbar","text":"Search:","listeners":{}},{"xtype":"TextField","|xns":"Roo.form","listeners":{"|render":"function (_self)\n{\n _this.searchBox = _self;\n}","|specialkey":"function (_self, e)\n{\n if(e.getKey() == 13) {\n _this.grid.footer.onClick('first');\n }\n}"},"width":135},{"xtype":"Button","|xns":"Roo.Toolbar","listeners":{"|click":"function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}"},"|icon":"rootURL + '\/Pman\/templates\/images\/search.gif'","cls":"x-btn-icon"},{"xtype":"Button","|xns":"Roo.Toolbar","listeners":{"|click":"function (_self, e)\n{\n _this.searchBox.setValue('');\n _this.grid.footer.onClick('first');\n}"},"|icon":"rootURL + '\/Pman\/templates\/images\/edit-clear.gif'","cls":"x-btn-icon"},{"xtype":"Separator","|xns":"Roo.Toolbar","listeners":{}},{"xtype":"TextItem","|xns":"Roo.Toolbar","text":"Show:","listeners":{}},{"xtype":"Button","|xns":"Roo.Toolbar","text":"All","listeners":{"|toggle":"function (_self, st)\n{\nif (st) { _this.filter = 'P,N,U'; } \n _this.grid.footer.onClick('first');\n}"},"toggleGroup":"pgrp","pressed":false,"enableToggle":true},{"xtype":"Button","|xns":"Roo.Toolbar","text":"Projects","listeners":{"|toggle":"function (_self, st)\n{\nif (st) { _this.filter = 'P,U'; } \n _this.grid.footer.onClick('first');\n}"},"toggleGroup":"pgrp","pressed":true,"enableToggle":true},{"xtype":"Button","|xns":"Roo.Toolbar","text":"Non-Projects","listeners":{"|toggle":"function (_self, st)\n{\nif (st) { _this.filter = 'N'; } \n _this.grid.footer.onClick('first');\n}"},"toggleGroup":"pgrp","pressed":false,"enableToggle":true},{"xtype":"Button","|xns":"Roo.Toolbar","text":"Closed","listeners":{"|toggle":"function (_self, st)\n{\nif (st) { _this.filter = 'X,C'; } \n _this.grid.footer.onClick('first');\n}"},"toggleGroup":"pgrp","pressed":false,"enableToggle":true}]},{"xtype":"RowSelectionModel","|xns":"Roo.grid","*prop":"selModel","listeners":{},"singleSelect":true}]}]}],"title":"Admin - Projects"} \ No newline at end of file diff --git a/Pman.Tab.AdminTranslations.bjs b/Pman.Tab.AdminTranslations.bjs new file mode 100644 index 0000000..1d581d8 --- /dev/null +++ b/Pman.Tab.AdminTranslations.bjs @@ -0,0 +1 @@ +{"xtype":"*Module","app":"Admin","modkey":999,"|module":"Pman.Tab.AdminTranslations","region":"center","name":"Pman.Tab.AdminTranslations","listeners":{},"|parent":"Pman.Tab.Admin","items":[{"xtype":"GridPanel","title":"Translations","fitToframe":true,"fitContainer":true,"background":true,"listeners":{"|activate":"function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.getDataSource().reload(); \n }\n}"},"items":[{"*prop":"grid","xtype":"EditorGrid","autoExpandColumn":"txt","loadMask":true,"listeners":{"|render":"function() { \n _this.grid = this; \n \/\/_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n _this.grid.getDataSource().reload(); \n }\n}","|beforeedit":"function(e) {\n console.log('beforeedit');\n \/\/if (e.record.get('origtxt').indexOf('<') > -1) {\n \/\/ console.log(\"HTML EDITOR!!\");\n \n \/\/ return false;\n \/\/}\n if (e.record.get('txt').replace(\/\\s+\/, '').length) {\n return true;\n }\n if (e.record.get('suggest').length) {\n e.record.set('txt', e.record.get('suggest'));\n \/\/ _this.saveRec(e.record);\n return;\n }\n \n \n \n \n var tl = e.record.get('id').split('\/')[0];\n \n tl = (tl == 'zh_HK') ? 'zh-TW' : tl; \n tl = tl.replace('_', '-');\n var rec = e.record;\n \n \n \n Pman.gtranslate(e.record.get('origtxt'), 'en', tl, function(result) { \n if (typeof(result) == 'object') { \/\/error\n return; \n }\n \n if (_this.grid.activeEditor) {\n _this.grid.activeEditor.setValue(result);\n } else {\n rec.set('txt',result);\n \/\/_this.saveRec(rec);\n }\n\n \/\/\n \n \n \/\/console.log(result.translation);\n });\n \n \n \n return true;\n } ","|afteredit":"function (e)\n{\n var saveRec = function(rec)\n {\n var g = _this.grid;\n\n \/\/g.getView().el.mask('Saving');\n Ext.Ajax.request({\n url : baseURL + '\/Admin\/Translations.php',\n method: 'POST',\n params : {\n id : rec.get('id'),\n txt : rec.get('txt'),\n lang : _this.langCombo.getValue(),\n module : _this.modCombo.getValue()\n },\n success : function()\n {\n \/\/g.getView().el.unmask();\n \/\/g.getDataSource().reload();\n },\n failure : function()\n {\n Ext.Msg.alert(\"Error\", \"There was a problem saving the data - try reloading\");\n \/\/ g.getView().el.unmask();\n }\n \n });\n };\n \n saveRec.defer(1000, _this, [ e.record ]);\n}"},"clicksToEdit":1,"|xns":"Roo.Grid","items":[{"*prop":"dataSource","xtype":"Store","|reader":"Pman.Readers.Category","listeners":{"|beforeload":"function (_self, opts)\n{\n\n if (!_this.langCombo || !_this.langCombo.getValue().length) {\n return false;\n }\n if (!_this.modCombo || !_this.modCombo.getValue().length) {\n return false;\n }\n opts.params = {\n lang : _this.langCombo.getValue(),\n module : _this.modCombo.getValue()\n };\n}"},"items":[{"*prop":"proxy","xtype":"HttpProxy","method":"GET","|url":"baseURL + '\/Admin\/Translations.php'","listeners":{}},{"xtype":"JsonReader","|xns":"Roo.data","*prop":"reader","root":"data","totalProperty":"total","id":"id","|fields":"[ 'id', 'tablename', 'tableid', 'colname', 'txt', 'lang', { name:'updated', type:'date', dateFormat: 'Y-m-d H:i:s' }, { name:'origupdated', type:'date', dateFormat: 'Y-m-d H:i:s' }, 'origtxt', 'msum', 'suggest' ]","listeners":{}}]},{"*prop":"colModel","xtype":"Array","listeners":{},"items":[{"xtype":"*ColumnModel","header":"Name","width":150,"dataIndex":"colname","|renderer":"function(v,x,r) { var c = '#666'; if (r.get('updated') < r.get('origupdated')) { c = 'red'; } return '
' +r.get('tableid')+ ':' + v + '<\/div>'; }","listeners":{}},{"xtype":"*ColumnModel","header":"Original","width":300,"dataIndex":"origtxt","|renderer":"function(v,x,r) { var c = '#666'; if (r.get('updated') < r.get('origupdated')) { c = 'red'; } return '
' + Ext.util.Format.htmlEncode(v) + '<\/div>'; }","listeners":{}},{"xtype":"*ColumnModel","header":"Translated (Click to Edit)","width":150,"dataIndex":"txt","|renderer":"function(v,x,r) { var c = '#666'; if (r.get('updated') < r.get('origupdated')) { c = 'red'; } return '
' + Ext.util.Format.htmlEncode(v) + '<\/div>'; }","listeners":{},"items":[{"xtype":"GridEditor","*prop":"editor","|xns":"Roo.grid","listeners":{},"items":[{"xtype":"TextField","*prop":"field","|xns":"Roo.form","listeners":{}}]}]}]},{"*prop":"toolbar","xtype":"Toolbar","listeners":{},"items":[{"xtype":"ComboBox","listeners":{"|render":"function (_self)\n{\n _this.modCombo = _self;\n}","|select":"function (combo, record, index)\n{\n _this.grid.getDataSource().reload(); \n}"},"valueField":"module","displayField":"module","width":200,"typeAhead":false,"editable":false,"mode":"local","triggerAction":"all","emptyText":"Select Module","selectOnFocus":true,"items":[{"xtype":"SimpleStore","|xns":"Roo.data","*prop":"store","listeners":{},"|fields":"['module']","|data":"(function() { var modlist = []; Roo.each( AppModules.split(','), function(mod) { \n modlist.push( [ mod ] ); }); return modlist; })()"}]},{"xtype":"ComboBox","listeners":{"|select":"function (combo, record, index)\n{\n _this.grid.getDataSource().reload(); \n}","|render":"function (_self)\n{\n _this.langCombo=_self;\n}"},"valueField":"lang","displayField":"ldisp","width":200,"typeAhead":false,"editable":false,"mode":"local","triggerAction":"all","emptyText":"Select Language","selectOnFocus":true,"items":[{"xtype":"SimpleStore","|xns":"Roo.data","*prop":"store","listeners":{},"|fields":"['lang', 'ldisp']","|data":"[ [ 'zh_HK' , '\\u7E41\\u4E2D - Trad. Chin. (HK)' ], [ 'zh_CN', '\\u7C21\\u4E2D - Simp. Chin.' ] ]"}]}]}]}]}],"title":"Admin - Translations"} \ No newline at end of file -- 2.39.2