{
- "id": "roo-file-348",
- "name": "Pman.Dialog.CoreAutoSavePreview",
- "parent": "",
- "title": "",
- "path": "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreAutoSavePreview.bjs",
- "items": [
+ "name" : "Pman.Dialog.CoreAutoSavePreview",
+ "parent" : "",
+ "title" : "",
+ "path" : "/home/johns/gitlive/Pman.Core/Pman.Dialog.CoreAutoSavePreview.bjs",
+ "permname" : "",
+ "modOrder" : "001",
+ "strings" : {
+ "53e5aa2c97fef1555d2511de8218c544" : "By",
+ "87f9f735a1d36793ceaecd4e47124b63" : "Events",
+ "ea4788705e6873b424c65e91c2846b19" : "Cancel",
+ "bd88a20b53a47f7b5704a83a15ff5506" : "Saved Version",
+ "44749712dbec183e983dcd78a7736c41" : "Date",
+ "e0aa021e21dddbd6d8cecec71e9cf564" : "OK"
+ },
+ "items" : [
+ {
+ "listeners" : {
+ "show" : "function (_self)\n{\n if(typeof(_this.data) != 'undefined'){\n _this.grid.footer.onClick('first');\n }\n \n}"
+ },
+ "modal" : true,
+ "collapsible" : false,
+ "background" : false,
+ "title" : "Saved Version",
+ "xtype" : "LayoutDialog",
+ "width" : 800,
+ "$ xns" : "Roo",
+ "closable" : false,
+ "resizable" : false,
+ "height" : 500,
+ "items" : [
+ {
+ "xtype" : "LayoutRegion",
+ "$ xns" : "Roo",
+ "* prop" : "center"
+ },
+ {
+ "xtype" : "LayoutRegion",
+ "$ xns" : "Roo",
+ "width" : 200,
+ "split" : true,
+ "* prop" : "west"
+ },
+ {
+ "listeners" : {
+ "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
+ },
+ "fitToframe" : true,
+ "background" : false,
+ "region" : "west",
+ "title" : "Events",
+ "xtype" : "GridPanel",
+ "fitContainer" : true,
+ "$ xns" : "Roo",
+ "tableName" : "Events",
+ "items" : [
+ {
+ "listeners" : {
+ "|render" : "function() \n{\n _this.grid = this; \n \n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}"
+ },
+ "autoExpandColumn" : "event_when",
+ "xtype" : "Grid",
+ "loadMask" : true,
+ "$ xns" : "Roo.grid",
+ "* prop" : "grid",
+ "items" : [
{
- "background": false,
- "closable": false,
- "collapsible": false,
- "height": 500,
- "modal": true,
- "resizable": false,
- "title": "Saved Version",
- "width": 800,
- "xtype": "LayoutDialog",
- "|xns": "Roo",
- "items": [
- {
- "*prop": "center",
- "titlebar": false,
- "xtype": "LayoutRegion",
- "|xns": "Roo"
- },
- {
- "*prop": "west",
- "split": true,
- "width": 300,
- "xtype": "LayoutRegion",
- "|xns": "Roo"
- },
- {
- "listeners": {
- "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
- },
- "background": false,
- "fitContainer": true,
- "fitToframe": true,
- "region": "west",
- "tableName": "Events",
- "title": "Events",
- "xtype": "GridPanel",
- "|xns": "Roo",
- "items": [
- {
- "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}"
- },
- "*prop": "grid",
- "autoExpandColumn": "remarks",
- "loadMask": true,
- "xtype": "Grid",
- "|xns": "Roo.grid",
- "items": [
- {
- "listeners": {
- "afterselectionchange": "function (_self)\n{\n // load detail log in _this.viewPanel;\n if (!this.getSelected()) {\n this.viewPanel.setContent(\"Nothing Selected\");\n return;\n }\n var id = this.getSelected().data.id;\n _this.viewPanel.load( { url : baseURL + \"/Admin/EventView/\" + id + \".html\" });\n \n}"
- },
- "*prop": "sm",
- "singleSelect": true,
- "xtype": "RowSelectionModel",
- "|xns": "Roo.grid"
- },
- {
- "listeners": {
- "|beforeload": "function (_self, o)\n{\n if (!Pman.buildCompleted) {\n return false;\n }\n \n \n if (! _this.personSel) {\n return false;\n }\n o.params = o.params || {};\n o.params.person_id = _this.personSel.getValue();\n var act = _this.actionSel.getValue();\n if (act.length) {\n o.params.action = act;\n }\n var tbl = _this.affectSel.getValue();\n if (tbl.length) {\n o.params.on_table = tbl;\n }\n act = _this.dateFrom.getValue();\n if (act.format) {\n o.params['query[from]'] = act.format('Y-m-d');\n }\n act = _this.dateTo.getValue();\n if (act.format) {\n o.params['query[to]'] = act.format('Y-m-d');\n }\n \n \n /*\n act = _this.groupedCombo.getValue();\n o.params['query[grouped]'] = act;\n if (o.params['query[grouped]'] == 'gr') {\n \n if (!tbl.length) {\n Roo.MessageBox.alert(\"Error\", \"Select a table to group results on\");\n return false;\n }\n// o.params['_columns'] = \n o.params['_distinct'] = 'on_id';\n \n \n }\n \n */\n\n \n}"
- },
- "*prop": "dataSource",
- "remoteSort": true,
- "xtype": "Store",
- "|sortInfo": "{ field: 'event_when', direction: 'DESC'}",
- "|xns": "Roo.data",
- "items": [
- {
- "|xns": "Roo.data",
- "xtype": "JsonReader",
- "totalProperty": "total",
- "root": "data",
- "*prop": "reader",
- "id": "id",
- "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]"
- },
- {
- "*prop": "proxy",
- "xtype": "HttpProxy",
- "method": "GET",
- "|url": "baseURL + '/Roo/Events.php'",
- "listeners": {},
- "|xns": "Roo.data"
- }
- ]
- },
- {
- "*prop": "footer",
- "xtype": "PagingToolbar",
- "pageSize": 25,
- "displayInfo": true,
- "displayMsg": "Displaying Events {0} - {1} of {2}",
- "emptyMsg": "No Events found",
- "|xns": "Roo",
- "items": [
- {
- "listeners": {
- "click": "function (_self, e)\n{\n \n var params = {\n 'sort' : 'event_when',\n 'dir' : 'DESC',\n 'start' : 0,\n 'limit' : 900,\n person_id : _this.personSel.getValue(), \n 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when', \n 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name', \n 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action', \n 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,\n 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',\n 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks' \n }\n \n params.person_id = _this.personSel.getValue();\n var act = _this.actionSel.getValue();\n if (act.length) {\n params.action = act;\n }\n var tbl = _this.affectSel.getValue();\n if (tbl.length) {\n params.on_table = tbl;\n }\n act = _this.dateFrom.getValue();\n if (act.format) {\n params['query[from]'] = act.format('Y-m-d');\n }\n act = _this.dateTo.getValue();\n if (act.format) {\n params['query[to]'] = act.format('Y-m-d');\n }\n params.limit = 9999;\n \n\n new Pman.download({\n url : baseURL + '/Roo/Events.php',\n params : params ,\n newWindow: true\n \n });\n}"
- },
- "text": "Download to Excel",
- "xtype": "Button",
- "|xns": "Roo.Toolbar"
- }
- ]
- },
- {
- "*prop": "toolbar",
- "xtype": "Toolbar",
- "listeners": {},
- "|xns": "Roo",
- "items": [
- {
- "xtype": "TextItem",
- "|xns": "Roo.Toolbar",
- "text": "Show",
- "listeners": {}
- },
- {
- "listeners": {
- "|select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n \n}",
- "|render": "function (_self)\n{\n _this.personSel = _self;\n}"
- },
- "allowBlank": true,
- "displayField": "name",
- "editable": true,
- "emptyText": "Select Person ",
- "fieldLabel": "Person ",
- "forceSelection": true,
- "listWidth": 600,
- "loadingText": "Searching...",
- "minChars": 2,
- "name": "person_id_name",
- "pageSize": 20,
- "qtip": "Select Person ",
- "queryParam": "query[name]",
- "selectOnFocus": true,
- "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>",
- "triggerAction": "all",
- "typeAhead": true,
- "valueField": "id",
- "width": 150,
- "xtype": "ComboBox",
- "|xns": "Roo.form",
- "items": [
- {
- "listeners": {
- "|beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n o.params.company_id = Pman.Login.authUser.company_id;\n}"
- },
- "*prop": "store",
- "remoteSort": true,
- "xtype": "Store",
- "|sortInfo": "{ field : 'name' , direction : 'ASC' }",
- "|xns": "Roo.data",
- "items": [
- {
- "*prop": "proxy",
- "method": "GET",
- "xtype": "HttpProxy",
- "|url": "baseURL + '/Roo/Person.php'",
- "|xns": "Roo.data"
- },
- {
- "*prop": "reader",
- "id": "id",
- "root": "data",
- "totalProperty": "total",
- "xtype": "JsonReader",
- "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'office_id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'phone',\n 'type': 'string'\n },\n {\n 'name': 'fax',\n 'type': 'string'\n },\n {\n 'name': 'email',\n 'type': 'string'\n },\n {\n 'name': 'company_id',\n 'type': 'int'\n },\n {\n 'name': 'role',\n 'type': 'string'\n },\n {\n 'name': 'active',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'lang',\n 'type': 'string'\n },\n {\n 'name': 'no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'action_type',\n 'type': 'string'\n },\n {\n 'name': 'project_id',\n 'type': 'int'\n },\n {\n 'name': 'deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'deleted_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'office_id_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_name',\n 'type': 'string'\n },\n {\n 'name': 'office_id_address',\n 'type': 'string'\n },\n {\n 'name': 'office_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'office_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'office_id_email',\n 'type': 'string'\n },\n {\n 'name': 'office_id_role',\n 'type': 'string'\n },\n {\n 'name': 'company_id_code',\n 'type': 'string'\n },\n {\n 'name': 'company_id_name',\n 'type': 'string'\n },\n {\n 'name': 'company_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'company_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_address',\n 'type': 'string'\n },\n {\n 'name': 'company_id_tel',\n 'type': 'string'\n },\n {\n 'name': 'company_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'company_id_email',\n 'type': 'string'\n },\n {\n 'name': 'company_id_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_isOwner',\n 'type': 'int'\n },\n {\n 'name': 'company_id_logo_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_background_color',\n 'type': 'string'\n },\n {\n 'name': 'company_id_comptype',\n 'type': 'string'\n },\n {\n 'name': 'company_id_url',\n 'type': 'string'\n },\n {\n 'name': 'company_id_main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_updated_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_updated_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'company_id_dispatch_port',\n 'type': 'string'\n },\n {\n 'name': 'company_id_province',\n 'type': 'string'\n },\n {\n 'name': 'company_id_country',\n 'type': 'string'\n },\n {\n 'name': 'project_id_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_name',\n 'type': 'string'\n },\n {\n 'name': 'project_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'project_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_code',\n 'type': 'string'\n },\n {\n 'name': 'project_id_active',\n 'type': 'int'\n },\n {\n 'name': 'project_id_type',\n 'type': 'string'\n },\n {\n 'name': 'project_id_client_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_team_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_file_location',\n 'type': 'string'\n },\n {\n 'name': 'project_id_open_date',\n 'type': 'date'\n },\n {\n 'name': 'project_id_open_by',\n 'type': 'int'\n },\n {\n 'name': 'project_id_close_date',\n 'type': 'date'\n },\n {\n 'name': 'project_id_countries',\n 'type': 'string'\n },\n {\n 'name': 'project_id_languages',\n 'type': 'string'\n },\n {\n 'name': 'project_id_agency_id',\n 'type': 'int'\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]",
- "|xns": "Roo.data"
- }
- ]
- }
- ]
- },
- {
- "listeners": {
- "|select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}",
- "|render": "function (_self)\n{\n _this.actionSel = _self;\n}"
- },
- "allowBlank": true,
- "displayField": "action",
- "editable": true,
- "emptyText": "Select Action",
- "forceSelection": true,
- "listWidth": 300,
- "loadingText": "Searching...",
- "minChars": 2,
- "name": "action",
- "pageSize": 20,
- "qtip": "Select Action",
- "queryParam": "query[action]",
- "selectOnFocus": true,
- "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>",
- "triggerAction": "all",
- "typeAhead": true,
- "valueField": "action",
- "width": 150,
- "xtype": "ComboBox",
- "|xns": "Roo.form",
- "items": [
- {
- "listeners": {
- "|beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n if (Pman.Login.authUser.company_id_comptype != 'OWNER') {\n o.params.company_id = Pman.Login.authUser.company_id;\n }\n o.params._distinct = 'action';\n o.params._columns ='action';\n}"
- },
- "*prop": "store",
- "remoteSort": true,
- "xtype": "Store",
- "|sortInfo": "{ field : 'action' , direction : 'ASC' }",
- "|xns": "Roo.data",
- "items": [
- {
- "*prop": "proxy",
- "method": "GET",
- "xtype": "HttpProxy",
- "|url": "baseURL + '/Roo/Events.php'",
- "|xns": "Roo.data"
- },
- {
- "*prop": "reader",
- "id": "id",
- "root": "data",
- "totalProperty": "total",
- "xtype": "JsonReader",
- "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]",
- "|xns": "Roo.data"
- }
- ]
- }
- ]
- },
- {
- "listeners": {
- "|select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}",
- "|render": "function (_self)\n{\n _this.affectSel = _self;\n}"
- },
- "allowBlank": true,
- "displayField": "on_table",
- "editable": true,
- "emptyText": "Select Affects",
- "forceSelection": true,
- "listWidth": 300,
- "loadingText": "Searching...",
- "minChars": 2,
- "name": "on_table",
- "pageSize": 20,
- "qtip": "Select Action",
- "queryParam": "query[on_table]",
- "selectOnFocus": true,
- "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
- "triggerAction": "all",
- "typeAhead": true,
- "valueField": "action",
- "width": 150,
- "xtype": "ComboBox",
- "|xns": "Roo.form",
- "items": [
- {
- "listeners": {
- "|beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n if (Pman.Login.authUser.company_id_comptype != 'OWNER') {\n o.params.company_id = Pman.Login.authUser.company_id;\n }\n o.params._distinct = 'on_table';\n o.params._columns ='on_table';\n}"
- },
- "*prop": "store",
- "remoteSort": true,
- "xtype": "Store",
- "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
- "|xns": "Roo.data",
- "items": [
- {
- "*prop": "proxy",
- "method": "GET",
- "xtype": "HttpProxy",
- "|url": "baseURL + '/Roo/Events.php'",
- "|xns": "Roo.data"
- },
- {
- "|xns": "Roo.data",
- "xtype": "JsonReader",
- "totalProperty": "total",
- "root": "data",
- "*prop": "reader",
- "id": "id",
- "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]"
- }
- ]
- }
- ]
- },
- {
- "text": "Date Range",
- "xtype": "TextItem",
- "|xns": "Roo.Toolbar"
- },
- {
- "listeners": {
- "render": "function (_self)\n{\n _this.dateFrom = _self;\n}",
- "change": "function (_self, newValue, oldValue)\n{\n _this.grid.footer.onClick('first');\n}"
- },
- "format": "Y-m-d",
- "xtype": "DateField",
- "|xns": "Roo.form"
- },
- {
- "listeners": {
- "render": "function (_self)\n{\n _this.dateTo = _self;\n}",
- "change": "function (_self, newValue, oldValue)\n{\n _this.grid.footer.onClick('first');\n}"
- },
- "format": "Y-m-d",
- "xtype": "DateField",
- "|xns": "Roo.form"
- }
- ]
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "event_when",
- "header": "Date",
- "width": 100,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }",
- "|xns": "Roo.grid"
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "on_table",
- "header": "Affected",
- "width": 100,
- "xtype": "ColumnModel",
- "|renderer": "function(v, x, r) { \n return v ? String.format('{0}({1})', v, r.data.on_id) : ''; \n }",
- "|xns": "Roo.grid"
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "remarks",
- "header": "Remarks",
- "width": 300,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('<span qtip=\"{1}\">{0}</span>', v, Roo.util.Format.htmlEncode(v)); }",
- "|xns": "Roo.grid"
- }
- ]
- }
- ]
- },
- {
- "listeners": {
- "|click": "function() {\n _this.dialog.hide();\n}"
- },
- "*prop": "buttons[]",
- "text": "Cancel",
- "xtype": "Button",
- "|xns": "Roo"
- },
- {
- "listeners": {
- "|click": "function() {\n _this.dialog.hide();\n}"
- },
- "*prop": "buttons[]",
- "text": "OK",
- "xtype": "Button",
- "|xns": "Roo"
- }
- ]
+ "listeners" : {
+ "afterselectionchange" : "function (_self)\n{\n var selected = this.getSelected();\n \n _this.source = '';\n \n if(!selected){\n _this.viewPanel.setContent(\"Please select an saved version on the left\"); \n return;\n }\n \n _this.viewPanel.load( { url : baseURL + \"/Roo/Events\", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){\n \n var res = Roo.decode(oResponse.responseText);\n \n if(!bSuccess || !res.success){\n _this.viewPanel.setContent(\"Load data failed?!\");\n }\n \n if(typeof(res.data) === 'string'){\n _this.viewPanel.setContent(res.data);\n return;\n }\n \n if(!_this.data.successFn){\n Roo.MessageBox.alert('Error', 'Please setup the successFn');\n return;\n }\n \n _this.source = _this.data.successFn(res);\n\n _this.viewPanel.setContent(_this.source);\n \n });\n}"
+ },
+ "xtype" : "RowSelectionModel",
+ "singleSelect" : true,
+ "$ xns" : "Roo.grid",
+ "* prop" : "sm"
+ },
+ {
+ "listeners" : {
+ "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n if(typeof(_this.data) == 'undefined'){\n this.removeAll();\n return false;\n }\n\n var d = Roo.apply({}, _this.data);\n delete d.successFn;\n\n Roo.apply(o.params, d);\n \n}",
+ "load" : "function (_self, records, options)\n{\n var sm = _this.grid.getSelectionModel();\n if (!sm.getSelections().length) {\n sm.selectFirstRow();\n \n sm.fireEvent('afterselectionchange', sm);\n }\n}"
+ },
+ "xtype" : "Store",
+ "remoteSort" : true,
+ "$ sortInfo" : "{ field : 'event_when', direction: 'DESC' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "dataSource",
+ "items" : [
+ {
+ "$ url" : "baseURL + '/Roo/Events.php'",
+ "method" : "GET",
+ "xtype" : "HttpProxy",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
+ },
+ {
+ "id" : "id",
+ "root" : "data",
+ "xtype" : "JsonReader",
+ "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'event_when',\n 'type': 'string'\n }\n]",
+ "$ xns" : "Roo.data",
+ "* prop" : "reader",
+ "totalProperty" : "total"
+ }
+ ]
+ },
+ {
+ "pageSize" : 25,
+ "xtype" : "PagingToolbar",
+ "$ xns" : "Roo",
+ "displayInfo" : false,
+ "* prop" : "footer"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "header" : "Date",
+ "width" : 100,
+ "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "event_when"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "width" : 100,
+ "header" : "By",
+ "$ renderer" : "function(v) { return String.format('{0}', v ); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "person_id_name"
}
- ],
- "permname": "",
- "modOrder": "001"
+ ]
+ }
+ ]
+ },
+ {
+ "listeners" : {
+ "render" : "function (_self)\n{\n _this.viewPanel = _self;\n}"
+ },
+ "autoScroll" : true,
+ "fitToFrame" : true,
+ "background" : false,
+ "region" : "center",
+ "xtype" : "ContentPanel",
+ "fitContainer" : true,
+ "$ xns" : "Roo"
+ },
+ {
+ "listeners" : {
+ "|click" : "function() {\n _this.dialog.hide();\n}"
+ },
+ "text" : "Cancel",
+ "xtype" : "Button",
+ "$ xns" : "Roo",
+ "* prop" : "buttons[]"
+ },
+ {
+ "listeners" : {
+ "|click" : "function() {\n\n _this.dialog.hide();\n \n if (_this.callback && _this.source != '') {\n _this.callback.call(this, _this.source);\n }\n}"
+ },
+ "text" : "OK",
+ "xtype" : "Button",
+ "$ xns" : "Roo",
+ "* prop" : "buttons[]"
+ }
+ ]
+ }
+ ]
}
\ No newline at end of file