Pman.Dialog.CoreAutoSavePreview.bjs
[Pman.Core] / Pman.Dialog.CoreAutoSavePreview.bjs
index fa35cea..bd28936 100644 (file)
@@ -1,11 +1,14 @@
 {
-    "id": "roo-file-348",
+    "id": "roo-file-208",
     "name": "Pman.Dialog.CoreAutoSavePreview",
     "parent": "",
     "title": "",
     "path": "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreAutoSavePreview.bjs",
     "items": [
         {
+            "listeners": {
+                "show": "function (_self)\n{\n    if(typeof(_this.data) != 'undefined'){\n        _this.grid.footer.onClick('first');\n    }\n}"
+            },
             "background": false,
             "closable": false,
             "collapsible": false,
             "modal": true,
             "resizable": false,
             "title": "Saved Version",
-            "width": 600,
+            "width": 800,
             "xtype": "LayoutDialog",
             "|xns": "Roo",
             "items": [
                 {
                     "*prop": "center",
-                    "split": true,
-                    "titlebar": false,
-                    "width": 400,
                     "xtype": "LayoutRegion",
                     "|xns": "Roo"
                 },
                 {
                     "*prop": "west",
+                    "split": true,
+                    "width": 200,
                     "xtype": "LayoutRegion",
                     "|xns": "Roo"
                 },
                 {
                     "listeners": {
-                        "|activate": "function() {\n    _this.wpanel = this;\n    if (_this.wgrid) {\n        _this.wgrid.footer.onClick('first');\n    }\n}"
+                        "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
                     },
-                    "background": true,
+                    "background": false,
                     "fitContainer": true,
                     "fitToframe": true,
                     "region": "west",
-                    "tableName": "clipping_journalist",
-                    "title": "Publication Lists",
+                    "tableName": "Images",
+                    "title": "Images",
                     "xtype": "GridPanel",
                     "|xns": "Roo",
                     "items": [
                         {
                             "listeners": {
-                                "|render": "function() \n{\n    _this.wgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.wpanel.active) {\n       this.footer.onClick('first');\n    }\n}"
+                                "|render": "function() \n{\n    _this.grid = this; \n    \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
+                                "|rowdblclick": "function (_self, rowIndex, e)\n{\n\n}\n"
                             },
                             "*prop": "grid",
-                            "autoExpandColumn": "publication",
+                            "autoExpandColumn": "filename",
                             "loadMask": true,
                             "xtype": "Grid",
                             "|xns": "Roo.grid",
                             "items": [
                                 {
                                     "listeners": {
-                                        "beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    o.params._list = 1;\n}"
+                                        "afterselectionchange": "function (_self)\n{\n    var selected = this.getSelected();\n    \n    if (!selected) {\n        _this.viewPanel.setContent(\"Nothing Selected\");\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        _this.source = res.data.POST.source;\n\n        _this.viewPanel.setContent(_this.source);\n        \n    });\n}"
                                     },
-                                    "*prop": "dataSource",
-                                    "remoteSort": true,
-                                    "xtype": "Store",
-                                    "|sortInfo": "{ field : 'publication', direction: 'ASC' }",
-                                    "|xns": "Roo.data",
-                                    "items": [
-                                        {
-                                            "*prop": "proxy",
-                                            "xtype": "HttpProxy",
-                                            "method": "GET",
-                                            "|url": "baseURL + '/Roo/Groups.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': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'type',\n        'type': 'int'\n    },\n    {\n        'name': 'leader',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_name',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_email',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_role',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_active',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_deleted_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'leader_firstname',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_lastname',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_name_facebook',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_url_blog',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_url_twitter',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_url_linkedin',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_crm_lead_percentage',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_crm_industry_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_crm_updated_action_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_crm_created_action_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_crm_type_id',\n        'type': 'int'\n    }\n]"
-                                        }
-                                    ]
-                                },
-                                {
-                                    "*prop": "footer",
-                                    "displayInfo": true,
-                                    "displayMsg": "Displaying Publication{0} - {1} of {2}",
-                                    "emptyMsg": "Nothing found",
-                                    "pageSize": 25,
-                                    "xtype": "PagingToolbar",
-                                    "|xns": "Roo"
-                                },
-                                {
-                                    "*prop": "colModel[]",
-                                    "dataIndex": "publication",
-                                    "header": "Publication Lists",
-                                    "width": 200,
-                                    "xtype": "ColumnModel",
-                                    "|renderer": "function(v) { return String.format('{0}', v); }",
+                                    "*prop": "sm",
+                                    "singleSelect": true,
+                                    "xtype": "RowSelectionModel",
                                     "|xns": "Roo.grid"
-                                }
-                            ]
-                        }
-                    ]
-                },
-                {
-                    "listeners": {
-                        "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
-                    },
-                    "background": true,
-                    "fitContainer": true,
-                    "fitToframe": true,
-                    "region": "center",
-                    "tableName": "clipping_journalist",
-                    "title": "Journalist",
-                    "xtype": "GridPanel",
-                    "|xns": "Roo",
-                    "items": [
-                        {
-                            "listeners": {
-                                "|render": "function() \n{\n    _this.grid = this; \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
-                            },
-                            "*prop": "grid",
-                            "autoExpandColumn": "name",
-                            "clicksToEdit": 1,
-                            "loadMask": true,
-                            "xtype": "EditorGrid",
-                            "|xns": "Roo.grid",
-                            "items": [
+                                },
                                 {
                                     "listeners": {
-                                        "beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    if (!_this.data.campaign_id) {\n        Roo.log('Missing campaign id!?');\n        return false;\n    }\n    o.params.campaign_id = _this.data.campaign_id;\n}"
+                                        "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    Roo.log(_this.data);\n    o.params.action = 'AUTOSAVE';\n}"
                                     },
                                     "*prop": "dataSource",
                                     "remoteSort": true,
                                     "xtype": "Store",
-                                    "|sortInfo": "{ field : 'name', direction: 'ASC' }",
+                                    "|sortInfo": "{ field : 'event_when', direction: 'DESC' }",
                                     "|xns": "Roo.data",
                                     "items": [
                                         {
                                             "*prop": "proxy",
                                             "method": "GET",
                                             "xtype": "HttpProxy",
-                                            "|url": "baseURL + '/Roo/clipping_journalist.php'",
+                                            "|url": "baseURL + '/Roo/Events.php'",
                                             "|xns": "Roo.data"
                                         },
                                         {
                                             "root": "data",
                                             "totalProperty": "total",
                                             "xtype": "JsonReader",
-                                            "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'publication',\n        'type': 'string'\n    }\n]",
+                                            "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'event_when',\n        'type': 'string'\n    }\n]",
                                             "|xns": "Roo.data"
                                         }
                                     ]
                                 },
                                 {
                                     "*prop": "footer",
-                                    "displayInfo": true,
-                                    "displayMsg": "Displaying Journalist {0} - {1} of {2}",
-                                    "emptyMsg": "Nothing found",
+                                    "displayInfo": false,
                                     "pageSize": 25,
                                     "xtype": "PagingToolbar",
                                     "|xns": "Roo"
                                 },
                                 {
                                     "*prop": "colModel[]",
-                                    "dataIndex": "name",
-                                    "header": "Name",
+                                    "dataIndex": "event_when",
+                                    "header": "Date",
                                     "width": 100,
                                     "xtype": "ColumnModel",
-                                    "|renderer": "function(v,x,r) \n{ \n    return String.format('{0}', v ? v : ''); \n}",
+                                    "|renderer": "function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }",
                                     "|xns": "Roo.grid"
-                                },
-                                {
-                                    "*prop": "colModel[]",
-                                    "dataIndex": "publication",
-                                    "header": "Publication",
-                                    "width": 300,
-                                    "xtype": "ColumnModel",
-                                    "|renderer": "function(v,x,r) \n{ \n    return String.format('{0}', v ? v : ''); \n}",
-                                    "|xns": "Roo.grid",
-                                    "items": [
-                                        {
-                                            "|xns": "Roo.grid",
-                                            "xtype": "GridEditor",
-                                            "*prop": "editor"
-                                        }
-                                    ]
                                 }
                             ]
                         }
                     ]
                 },
+                {
+                    "listeners": {
+                        "render": "function (_self)\n{\n    _this.viewPanel = _self;\n}"
+                    },
+                    "autoScroll": true,
+                    "background": false,
+                    "fitContainer": true,
+                    "fitToFrame": true,
+                    "region": "center",
+                    "xtype": "ContentPanel",
+                    "|xns": "Roo"
+                },
                 {
                     "listeners": {
                         "|click": "function() {\n    _this.dialog.hide();\n}"
                 },
                 {
                     "listeners": {
-                        "|click": "function() {\n    _this.dialog.hide();\n}"
+                        "|click": "function() {\n    Roo.log(_this.source);\n    _this.dialog.hide();\n\n}"
                     },
                     "*prop": "buttons[]",
                     "text": "OK",