{
    "type": "Ext.panel.Panel",
    "reference": {
        "name": "items",
        "type": "array"
    },
    "codeClass": null,
    "userConfig": {
        "autoScroll": true,
        "border": false,
        "defaults": null,
        "designer|initialView": true,
        "designer|userClassName": "MainPanel",
        "header": false,
        "height": 567,
        "itemId": "dashboardPanel",
        "layout": "fit",
        "padding": "3 10 0 10",
        "title": "License Archive",
        "width": 997
    },
    "designerId": "3afe77e0-8058-4fea-b465-de8096db13d1",
    "cn": [
        {
            "type": "Ext.container.Container",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "container|align": "stretch",
                "layout": "vbox"
            },
            "designerId": "c415805e-6673-4426-98a2-c654b2e7037c",
            "cn": [
                {
                    "type": "Ext.form.FieldSet",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "container|align": "stretch",
                        "layout": "vbox",
                        "layout|flex": 2,
                        "title": "License mapping"
                    },
                    "designerId": "93d7a2e2-134f-44c2-8b98-840ac7534b83",
                    "cn": [
                        {
                            "type": "Ext.tree.Panel",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "border": false,
                                "header": false,
                                "height": 250,
                                "itemId": "licenseMap",
                                "layout|flex": 1,
                                "margin": "0 0 10 0",
                                "rootVisible": false,
                                "store": "LicenseMapping",
                                "title": "My Tree Grid Panel",
                                "width": 400
                            },
                            "designerId": "151e1281-fc33-4c34-aa66-b7142cd104d1",
                            "isBuiltIn": true,
                            "iconCls": "icon-treegridpanel",
                            "autoName": "TreeGrid",
                            "cn": [
                                {
                                    "type": "Ext.tree.View",
                                    "reference": {
                                        "name": "viewConfig",
                                        "type": "object"
                                    },
                                    "codeClass": null,
                                    "designerId": "0e588a17-56b7-4f46-8a63-bc6faffba5ca"
                                },
                                {
                                    "type": "Ext.tree.Column",
                                    "reference": {
                                        "name": "columns",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "dataIndex": "category",
                                        "flex": 1,
                                        "text": "Consolidated license category",
                                        "width": 376
                                    },
                                    "designerId": "b7b58ab4-97ed-4d9e-bda7-fa46b1a3373d"
                                },
                                {
                                    "type": "Ext.grid.column.Column",
                                    "reference": {
                                        "name": "columns",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "dataIndex": "dash_abbr",
                                        "flex": null,
                                        "text": "Abbr."
                                    },
                                    "designerId": "6fbcd8e7-abb6-4ef9-99d1-4efb379ecb56"
                                },
                                {
                                    "type": "Ext.grid.column.Column",
                                    "reference": {
                                        "name": "columns",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "align": "center",
                                        "cls": "setLeft",
                                        "dataIndex": "dash_incl",
                                        "flex": null,
                                        "text": "",
                                        "width": 30
                                    },
                                    "designerId": "efa7f5a1-3d47-4027-8a74-e9ae1d88a015",
                                    "cn": [
                                        {
                                            "type": "fixedfunction",
                                            "reference": {
                                                "name": "items",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "designer|params": [
                                                    "value",
                                                    "metaData",
                                                    "record",
                                                    "rowIndex",
                                                    "colIndex",
                                                    "store",
                                                    "view"
                                                ],
                                                "fn": "renderer",
                                                "implHandler": [
                                                    "if(value)\r",
                                                    "\treturn '<img src = \"../gfx/green_checkmark.png\" title=\"'+CCS.Translator.getText('This category is included on dashboards.')+'\" />';\r",
                                                    "else\r",
                                                    "\treturn '';"
                                                ]
                                            },
                                            "designerId": "e9257b0e-7541-409d-a585-80ac81e60324"
                                        }
                                    ]
                                },
                                {
                                    "type": "Ext.grid.column.Column",
                                    "reference": {
                                        "name": "columns",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "dataIndex": "sapLicense",
                                        "flex": 1,
                                        "text": "SAP license"
                                    },
                                    "designerId": "acd94877-75f6-4bf1-936a-7717b81a1507"
                                },
                                {
                                    "type": "Ext.grid.column.Column",
                                    "reference": {
                                        "name": "columns",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "align": null,
                                        "cls": null,
                                        "dataIndex": "syscli",
                                        "flex": null,
                                        "text": "System / Client"
                                    },
                                    "designerId": "5a7045d2-f00a-4733-95af-fadff606aec0"
                                },
                                {
                                    "type": "Ext.grid.column.Column",
                                    "reference": {
                                        "name": "columns",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "align": "right",
                                        "cls": "setLeft",
                                        "dataIndex": "mapped_roles",
                                        "text": "Roles"
                                    },
                                    "designerId": "dcfc400a-10e6-4dcc-84cc-3f5843994b1b"
                                },
                                {
                                    "type": "Ext.grid.column.Column",
                                    "reference": {
                                        "name": "columns",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "dataIndex": "license_type",
                                        "text": "License type"
                                    },
                                    "designerId": "7ed07d26-4108-444c-af40-3804804e1780"
                                },
                                {
                                    "type": "Ext.grid.column.Column",
                                    "reference": {
                                        "name": "columns",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "align": "right",
                                        "cls": "setLeft",
                                        "dataIndex": "quantity",
                                        "text": "Quantity"
                                    },
                                    "designerId": "4f423333-3ade-4bb8-a2aa-2e215e958a28"
                                },
                                {
                                    "type": "Ext.grid.column.Column",
                                    "reference": {
                                        "name": "columns",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "align": "right",
                                        "cls": "setLeft",
                                        "dataIndex": "cost",
                                        "text": "Cost"
                                    },
                                    "designerId": "e67208d2-10a0-4d66-af67-11d92e46805a"
                                }
                            ]
                        },
                        {
                            "type": "Ext.container.Container",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "container|align": "stretch",
                                "layout": "hbox",
                                "margin": "0 0 10 0"
                            },
                            "designerId": "02571005-da79-45c4-972a-6f7ec9826ca4",
                            "cn": [
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "icon": "../gfx/license_consolidated.png",
                                        "itemId": "btnCreateCategory",
                                        "scale": "medium",
                                        "text": "New consolidated",
                                        "textAlign": null
                                    },
                                    "designerId": "19261615-a725-47ec-968a-fd32ccf40ba0"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": null,
                                        "width": 10
                                    },
                                    "designerId": "7354d802-b3a5-4853-91fe-755422dd50f7"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "icon": "../gfx/license_consolidated.png",
                                        "itemId": "btnEditCategory",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Edit consolidated",
                                        "textAlign": null
                                    },
                                    "designerId": "3d255e5d-9ad8-4005-81d8-88a015683701"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": null,
                                        "width": 10
                                    },
                                    "designerId": "ae47df3b-8b8d-4764-816c-5906c97ccf25"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "icon": "../gfx/delete.png",
                                        "itemId": "btnDeleteCategory",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Delete consolidated",
                                        "textAlign": null
                                    },
                                    "designerId": "32f766c6-1918-4112-bd69-975a107570c7"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": 1,
                                        "width": null
                                    },
                                    "designerId": "2da33387-cc0d-477e-b887-e6a0bd4446fa"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "icon": "../gfx/license.png",
                                        "itemId": "btnCreate",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Create"
                                    },
                                    "designerId": "ae78eca7-2102-437e-b0d4-3178ac80e414"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": null,
                                        "width": 10
                                    },
                                    "designerId": "10780a6b-6b47-48ec-b90d-911e697f4bd6"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "icon": "../gfx/license.png",
                                        "itemId": "btnEdit",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Edit"
                                    },
                                    "designerId": "71b13024-4e77-4cb4-9a8c-f370d2464ef4"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": null,
                                        "width": 10
                                    },
                                    "designerId": "ea7e8772-2a22-48e8-a5be-787afc5df4f9"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "icon": "../gfx/sap_license.png",
                                        "itemId": "btnMapSap",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Map to SU01 license"
                                    },
                                    "designerId": "d3e84f53-f43f-4aee-a600-67dfcf62cc21"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": null,
                                        "width": 10
                                    },
                                    "designerId": "78d1554e-a438-48b8-a96e-967d7fcf4252"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "icon": "../gfx/link.png",
                                        "itemId": "btnMapExisting",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Link existing UM category",
                                        "tooltip": "Map to an existing UM category"
                                    },
                                    "configAlternates": {
                                        "tooltip": "string"
                                    },
                                    "designerId": "e8102fc4-8c52-4b79-8cd1-a6c500b144e5"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": null,
                                        "width": 10
                                    },
                                    "designerId": "67499e82-2a1d-49f0-86ff-72c89b6c0380"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "icon": "../gfx/unlink.png",
                                        "itemId": "btnUnmap",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Unlink"
                                    },
                                    "designerId": "413a422a-5c1b-4055-a364-460d3a425de0"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": null,
                                        "width": 10
                                    },
                                    "designerId": "e01bc7ba-eaa2-429c-9c0f-3ac095de1e4c"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "icon": "../gfx/delete.png",
                                        "itemId": "btnDeleteLocal",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Delete"
                                    },
                                    "designerId": "92cb85c2-5505-4b9b-a181-0a1c3a83a636"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "Ext.resizer.Splitter",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "cls": null,
                        "componentCls": null,
                        "overCls": null
                    },
                    "designerId": "47a8dd17-0076-4196-9803-ae45371cf332"
                },
                {
                    "type": "Ext.form.FieldSet",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "container|align": "stretch",
                        "layout": "vbox",
                        "layout|flex": 1,
                        "title": "License purchases",
                        "width": 10
                    },
                    "designerId": "fab0ced8-fb7e-47d6-95df-487896cee26c",
                    "cn": [
                        {
                            "type": "Ext.container.Container",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "itemId": "GridContainer",
                                "layout": "fit",
                                "layout|flex": 1
                            },
                            "designerId": "f45b08fc-877a-490b-acd4-d3ffbca241b5",
                            "cn": [
                                {
                                    "type": "Ext.grid.Panel",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "header": false,
                                        "itemId": "GridPanel",
                                        "store": "fileStore",
                                        "title": "My Grid Panel"
                                    },
                                    "designerId": "0eb7badf-1273-4323-bfec-7ba6a923a1b1",
                                    "cn": [
                                        {
                                            "type": "Ext.grid.column.Column",
                                            "reference": {
                                                "name": "columns",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "dataIndex": "FID",
                                                "hidden": true,
                                                "itemId": "fileID",
                                                "text": "FileID"
                                            },
                                            "designerId": "e4a0f72e-de33-44bd-addb-4f8783bce948"
                                        },
                                        {
                                            "type": "Ext.grid.column.Column",
                                            "reference": {
                                                "name": "columns",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "dataIndex": "purchaseDate",
                                                "itemId": "invoiceDate",
                                                "text": "Purchase date"
                                            },
                                            "designerId": "6f1d3ec3-6415-4e66-99c2-4396a923baff"
                                        },
                                        {
                                            "type": "Ext.grid.column.Column",
                                            "reference": {
                                                "name": "columns",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "dataIndex": "name",
                                                "itemId": "name",
                                                "text": "Name",
                                                "width": 135
                                            },
                                            "designerId": "e890f1a6-d983-4608-9bc5-8fd12e2c11f6",
                                            "cn": [
                                                {
                                                    "type": "Ext.form.field.Text",
                                                    "reference": {
                                                        "name": "editor",
                                                        "type": "object"
                                                    },
                                                    "codeClass": null,
                                                    "userConfig": {
                                                        "itemId": "nameInputField"
                                                    },
                                                    "designerId": "a7776748-f2ca-484c-a577-5cf9b50061cf"
                                                }
                                            ]
                                        },
                                        {
                                            "type": "Ext.grid.column.Column",
                                            "reference": {
                                                "name": "columns",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "dataIndex": "comment",
                                                "flex": 1,
                                                "itemId": "commentDesciption",
                                                "text": "Comment / Description"
                                            },
                                            "designerId": "4d0ec2b3-09a4-4371-a1fa-0c44fe7c8ec4",
                                            "cn": [
                                                {
                                                    "type": "Ext.form.field.Text",
                                                    "reference": {
                                                        "name": "editor",
                                                        "type": "object"
                                                    },
                                                    "codeClass": null,
                                                    "userConfig": {
                                                        "itemId": "commentInputField"
                                                    },
                                                    "designerId": "4f0e47b1-2b2d-4fae-b946-085d2e265a2f"
                                                }
                                            ]
                                        },
                                        {
                                            "type": "Ext.grid.column.Column",
                                            "reference": {
                                                "name": "columns",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "dataIndex": "amount",
                                                "itemId": "amount",
                                                "text": "Amount"
                                            },
                                            "designerId": "07f75292-5274-4d3d-997a-9895be5c7e9a"
                                        },
                                        {
                                            "type": "Ext.grid.column.Column",
                                            "reference": {
                                                "name": "columns",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "align": "center",
                                                "dataIndex": "file_name",
                                                "itemId": "file",
                                                "text": "File",
                                                "width": 70
                                            },
                                            "designerId": "8834ee33-239e-4adc-90ea-f39b9e244a29",
                                            "cn": [
                                                {
                                                    "type": "fixedfunction",
                                                    "reference": {
                                                        "name": "items",
                                                        "type": "array"
                                                    },
                                                    "codeClass": null,
                                                    "userConfig": {
                                                        "designer|params": [
                                                            "value",
                                                            "metaData",
                                                            "record",
                                                            "rowIndex",
                                                            "colIndex",
                                                            "store",
                                                            "view"
                                                        ],
                                                        "fn": "renderer",
                                                        "implHandler": [
                                                            "var encodedData = record.data.file_data;\r",
                                                            "var FID = record.data.FID;\r",
                                                            "\r",
                                                            "button = \"<img border='0' src='../gfx/tool-down.gif' title='\"+CCS.Translator.getText('Download')+\"' \" +\r",
                                                            "\t\t\t\t\t\"onmouseover=this.style.cursor='pointer' \"+\r",
                                                            "\t\t\t\t\t\"onclick=\"+'\"'+\r",
                                                            "\t\t\t\t\t\t\"MyApp.app.getController('GridController').downloadFile('\"+FID+\"');\"+\r",
                                                            "\t\t\t\t\t'\"'+\r",
                                                            "\t\t\t\t\" />\";\r",
                                                            "\r",
                                                            "return button;\r",
                                                            "\r",
                                                            "\r",
                                                            "\r",
                                                            "\r",
                                                            ""
                                                        ]
                                                    },
                                                    "designerId": "adfd4a68-60d0-4233-8792-6a13f9234c6d"
                                                }
                                            ]
                                        },
                                        {
                                            "type": "Ext.grid.column.Column",
                                            "reference": {
                                                "name": "columns",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "dataIndex": "uploadDate",
                                                "itemId": "uploadCreateDate",
                                                "text": "Upload date / Create date",
                                                "width": 140
                                            },
                                            "designerId": "6c709aad-c329-4725-a410-b6839dd1f008"
                                        },
                                        {
                                            "type": "Ext.grid.View",
                                            "reference": {
                                                "name": "viewConfig",
                                                "type": "object"
                                            },
                                            "codeClass": null,
                                            "designerId": "2d16b72a-d667-408a-b3d9-47f6f4d22bab"
                                        },
                                        {
                                            "type": "Ext.grid.plugin.CellEditing",
                                            "reference": {
                                                "name": "plugins",
                                                "type": "array"
                                            },
                                            "codeClass": "Ext.grid.plugin.CellEditing",
                                            "designerId": "2de5c4fb-4677-445d-b9e6-f744d7eaebaf"
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "Ext.container.Container",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "container|align": "stretch",
                                "container|padding": "7 7 7 7",
                                "itemId": "uploadBtnContainer",
                                "layout": "hbox",
                                "layout|flex": 1,
                                "margin": null,
                                "maxHeight": 45
                            },
                            "designerId": "87e2d068-5f4f-4be4-91f9-051b4f5c9ee5",
                            "cn": [
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "icon": "../gfx/add.png",
                                        "itemId": "newLicBtn",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "New license"
                                    },
                                    "designerId": "c1aa7963-c8d5-42ec-9f7c-3a5f2a0fe351"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": null,
                                        "width": 10
                                    },
                                    "designerId": "2cdb34f5-93fe-487e-92c8-7970fb2b05d5"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "hidden": true,
                                        "icon": "../gfx/license_consolidated.png",
                                        "itemId": "editLicBtn",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Edit license"
                                    },
                                    "designerId": "e0e27dc5-f5e8-40ed-a71b-8d916e395713"
                                },
                                {
                                    "type": "Ext.toolbar.Spacer",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "layout|flex": null,
                                        "width": 10
                                    },
                                    "designerId": "66c36818-4ebb-4516-8ab8-268b299842da"
                                },
                                {
                                    "type": "Ext.button.Button",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "disabled": true,
                                        "icon": "../gfx/delete.png",
                                        "itemId": "deleteLicBtn",
                                        "layout|flex": null,
                                        "scale": "medium",
                                        "text": "Delete license"
                                    },
                                    "designerId": "7e42cdc6-c312-4e43-b486-ecfa3eb01796"
                                }
                            ]
                        },
                        {
                            "type": "Ext.container.Container",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "container|align": "stretch",
                                "disabled": true,
                                "hidden": true,
                                "itemId": "uploadContainer",
                                "layout": "hbox"
                            },
                            "designerId": "991b2167-7f36-42bf-b03e-3d6daf5f4efd",
                            "cn": [
                                {
                                    "type": "Ext.form.Panel",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "bodyPadding": 10,
                                        "border": false,
                                        "container|align": "stretch",
                                        "header": false,
                                        "itemId": "uploadForm",
                                        "layout": "hbox",
                                        "layout|flex": 1,
                                        "maxWidth": null,
                                        "title": "Upload file"
                                    },
                                    "designerId": "2f72b2f5-8ad5-45ff-b6bd-39eb5a43bfab",
                                    "cn": [
                                        {
                                            "type": "Ext.form.field.File",
                                            "reference": {
                                                "name": "items",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "allowBlank": false,
                                                "buttonText": "Select file",
                                                "fieldLabel": "File",
                                                "id": null,
                                                "itemId": "fileUploadField",
                                                "labelWidth": 50,
                                                "layout|flex": 1,
                                                "msgTarget": "side",
                                                "name": "file"
                                            },
                                            "designerId": "46066b03-33db-40c8-912f-43b941e7ba6f"
                                        },
                                        {
                                            "type": "Ext.form.field.Date",
                                            "reference": {
                                                "name": "items",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "allowBlank": false,
                                                "fieldLabel": "Purchase date",
                                                "format": "Y-m-d",
                                                "itemId": "invoiceDateField",
                                                "layout|flex": null,
                                                "name": "invoicedate",
                                                "padding": "0 0 0 10"
                                            },
                                            "designerId": "0dc263fe-fee0-4b00-b70f-b4943a39bf58"
                                        },
                                        {
                                            "type": "Ext.form.field.Number",
                                            "reference": {
                                                "name": "items",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "allowBlank": false,
                                                "fieldLabel": "Amount",
                                                "itemId": "amountField",
                                                "labelWidth": 50,
                                                "layout|flex": null,
                                                "name": "amount",
                                                "padding": "0 0 0 10"
                                            },
                                            "designerId": "1e5c6575-1cd2-44fe-9749-4e91213acc2a"
                                        },
                                        {
                                            "type": "Ext.toolbar.Spacer",
                                            "reference": {
                                                "name": "items",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "layout|flex": null,
                                                "width": 10
                                            },
                                            "designerId": "2dd29102-988e-463f-a7f7-c6a7600a66a5"
                                        },
                                        {
                                            "type": "Ext.button.Button",
                                            "reference": {
                                                "name": "items",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "itemId": "uploadButton",
                                                "text": "Upload"
                                            },
                                            "designerId": "320e8f02-1807-40f6-9347-75e39919fc0e",
                                            "cn": [
                                                {
                                                    "type": "fixedfunction",
                                                    "reference": {
                                                        "name": "items",
                                                        "type": "array"
                                                    },
                                                    "codeClass": null,
                                                    "userConfig": {
                                                        "designer|params": [
                                                            "button",
                                                            "e"
                                                        ],
                                                        "fn": "handler",
                                                        "implHandler": [
                                                            "var orgParams = Ext.Object.fromQueryString(document.location.search);\r",
                                                            "\r",
                                                            "var tempurl = '../../service/upload_file.php?user=' + orgParams.user;\r",
                                                            "\r",
                                                            "var form = this.up('form').getForm();\r",
                                                            "var gridPanel = MyApp.app.getController('GridController').getGridPanel();\r",
                                                            "\r",
                                                            "/*var uploadField = MyApp.app.getController('GridController').getFileUploadField();\r",
                                                            "console.log(uploadField);\r",
                                                            "console.log(uploadField.getEl());*/\r",
                                                            "\r",
                                                            "\r",
                                                            "\r",
                                                            "if (form.isValid())\r",
                                                            "{\r",
                                                            "\tgridPanel.setLoading(CCS.Translator.getText('Loading...'));\r",
                                                            "\r",
                                                            "\t//console.log('UPLOAD FILE');\r",
                                                            "\r",
                                                            "\tform.submit({\r",
                                                            "\t\turl: tempurl,\r",
                                                            "\t\twaitMsg: 'Uploading file',\r",
                                                            "\t\tsuccess: function(fp, o) {\r",
                                                            "\t\t\tconsole.log(o.result.data);\r",
                                                            "\r",
                                                            "\t\t\tgridPanel.setLoading(false);\r",
                                                            "\t\t\tgridPanel.getStore().load();\r",
                                                            "\t\t\tif (o.result.data !== undefined || o.result.data !== null)\r",
                                                            "\t\t\t{\r",
                                                            "\t\t\t\tvar convertedSize = convertSize(o.result.data.size);\r",
                                                            "\t\t\t\tExt.Msg.alert(o.result.msg, 'Upload: <b>' + o.result.data.name + '</b> <br> Size: <b>' + convertedSize + '</b>');\r",
                                                            "\r",
                                                            "\t\t\t\tvar periodDateField = MyApp.app.getController('GridController').getPeriodDateField();\r",
                                                            "\t\t\t\t//periodDateField.reset();\r",
                                                            "\t\t\t\tvar invoiceDateField = MyApp.app.getController('GridController').getInvoiceDateField();\r",
                                                            "\t\t\t\t//invoiceDateField.reset();\r",
                                                            "\t\t\t\tvar amountField = MyApp.app.getController('GridController').getAmountField();\r",
                                                            "\t\t\t\t//amountField.reset();\r",
                                                            "\t\t\t}\r",
                                                            "\t\t},\r",
                                                            "\t\tfailure: function(fp, o) {\r",
                                                            "\t\t\t//console.log('FAILURE');\r",
                                                            "\r",
                                                            "\t\t\tgridPanel.setLoading(false);\r",
                                                            "\t\t\tvar message = \"\";\r",
                                                            "\t\t\tif (o.result.data !== undefined || o.result.data !== null)\r",
                                                            "\t\t\t{\r",
                                                            "\t\t\t\tvar convertedSize = convertSize(o.result.data.size);\r",
                                                            "\t\t\t\tif (o.result.data.error == \"size\")\r",
                                                            "\t\t\t\t{\r",
                                                            "\t\t\t\tvar convetedMaxSize = convertSize(o.result.data.maxsize);\r",
                                                            "\t\t\t\tmessage = 'The file <b>' + o.result.data.name + '</b> is <b>' + convertedSize + '</b><br>';\r",
                                                            "\t\t\t\tmessage += 'Max file size is <b>'+ convetedMaxSize +'</b>';\r",
                                                            "\t\t\t\t}\r",
                                                            "\t\t\t\telse if (o.result.data.error == \"file\")\r",
                                                            "\t\t\t\t{\r",
                                                            "\t\t\t\t\tmessage = o.result.data.errormsg;\r",
                                                            "\t\t\t\t}\r",
                                                            "\r",
                                                            "\t\t\t\tExt.Msg.alert(o.result.msg, message);\r",
                                                            "\t\t\t}\r",
                                                            "\t\t}\r",
                                                            "\t});\r",
                                                            "}\r",
                                                            "\r",
                                                            "\r",
                                                            "function convertSize(size) {\r",
                                                            "\tif (size >= (1024*1024)) // 1 MB\r",
                                                            "\t{\r",
                                                            "\t\tvalue = size / (1024 * 1024);\r",
                                                            "\t\treturn value.toFixed(1) + \" MB\";\r",
                                                            "\t}\r",
                                                            "\telse if (size >= 1024) // 1 KB\r",
                                                            "\t{\r",
                                                            "\t\tvalue = size / 1024;\r",
                                                            "\t\treturn value.toFixed(1) + \" KB\";\r",
                                                            "\t}\r",
                                                            "\telse\r",
                                                            "\t{\r",
                                                            "\t\treturn size + \" B\";\r",
                                                            "\t}\r",
                                                            "}"
                                                        ]
                                                    },
                                                    "designerId": "6fd0c4e0-852b-42a7-b02a-59aa6b189b61"
                                                }
                                            ]
                                        },
                                        {
                                            "type": "Ext.toolbar.Spacer",
                                            "reference": {
                                                "name": "items",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "layout|flex": 1
                                            },
                                            "designerId": "ae579089-745b-43c9-b29c-f1ab15b43c7c"
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "Ext.container.Container",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "hidden": true,
                                "itemId": "emptyContainer"
                            },
                            "designerId": "c69dac58-7aac-460f-9a8a-3098010ad007"
                        }
                    ]
                }
            ]
        }
    ]
}