Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleItem.bjs
1 {
2  "name" : "Pman.Dialog.XtupleItem",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.Xtuple/Pman.Dialog.XtupleItem.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "346577d22bb510368e3eddab5df2ca13" : "Reference Files",
10   "be53a0541a6d36f6ecb879fa2c584b08" : "Image",
11   "92b17d3d0f13232ec1d46844c836d4db" : "Invoice UOM",
12   "390fc24b0feebfff8c3fb8625418c2e9" : "Perishable",
13   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
14   "956e816fa19ca04485c7101adbe07762" : "Displaying records {0} - {1} of {2}",
15   "69395719de41dd8a31905b1e94c91816" : "Select classcode",
16   "82a43f89af6d331d80d441624c5c71fa" : "Default Location",
17   "538a3c9d82a4ea4250b987a357d41184" : "Item Parts",
18   "03ab340b3f99e03cff9e84314ead38c0" : "Qty",
19   "5b8c99dad1893a85076709b2d3c2d2d0" : "IP Address",
20   "fce71ab09b7795157c6e23370b4afb26" : "Stocked",
21   "045a1ac263ac3a9b7420208bdc2df423" : "Select costcat",
22   "0c81971f67c0bd4b33799c5365ec2bf5" : "No Images found",
23   "a1fa27779242b4902f7ae3bdd5c6d508" : "Type",
24   "151ccf95db9b81c11bb20fbc302af4b6" : "Select terms",
25   "786410e93beb0193d89f8608c54feb4b" : "Select item",
26   "0ac9012a8c03a76ee76f04321b3b7fda" : "Lead time",
27   "675c9bd3bbae30af03fe74346dcae9a7" : "Edit / Create item",
28   "dd24f967299e81b9603cb071693d5c32" : "Select vendinfo",
29   "023a5dfa857c4aa0156e6685231a1dbd" : "Select Type",
30   "e8586011952b0d098b0e568f20ca2b1f" : "Select Currency",
31   "9bd81329febf6efe22788e03ddeaf0af" : "Class",
32   "8413c683b4b27cc3f4dbd4c90329d8ba" : "Comments",
33   "820dbd2b8f606aff866c0bbfb6b737c1" : "Changed",
34   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
35   "0eceeb45861f9585dd7a97a3e36f85c6" : "Created",
36   "386c339d37e737a436499d423a77df0c" : "Currency",
37   "9076cbba1d9ef79280b4f39e2aa0d115" : "Nothing found",
38   "1243daf593fa297e07ab03bf06d925af" : "Searching...",
39   "6df5afb79e960381ed66568c2a644ec6" : "Description (2)",
40   "7be1fa478799242847d4ef861ff6f8e1" : "Min Qty",
41   "6665e3761028c84e1d228de3432229ed" : "SKU",
42   "e54f1b41d200adbd96eb53634388d780" : "Sales Account",
43   "76729937a5eb6b0fd88c42581161facd" : "Select Category",
44   "eccd13e2f1acfd6b8412a2caafa37a80" : "Stock Safety Level",
45   "43b2683180fe5e67a91696c834df0a32" : "Reorder Level",
46   "e1a8f447925ed2867c591aa0865d170e" : "Multi Location",
47   "7d74f3b92b19da5e606d737d339a9679" : "Item",
48   "2ea154449c00001e87af8df7c0728678" : "Control Method",
49   "19df363d15888baa395364fbcd230c05" : "No itemsrc found",
50   "0d122b17933ab4173e9d75d55fc5e764" : "Standard Cost",
51   "df2ad52a14d681b1cd8495f8650fdb56" : "Select prodcat",
52   "49ee3087348e8d44e1feda1917443987" : "Name",
53   "e5353fc67b122d1b42181073b46cd060" : "Vendor Ref#",
54   "c19ea8f7a11074ac743c58d34830b233" : "Select plancode",
55   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
56   "c056b1456660ea65aad6dfc664002b84" : "Item active",
57   "9d98e31f261471f426e906282544c15d" : "Item comments",
58   "20f39d1311ccbd3b7e61cdd4978719f9" : "Itemsite Settings",
59   "1656a671ba692e15836cd85df374556c" : "Price List",
60   "bb8913cd17d59f182acc7be1020007b7" : "UOM",
61   "f9c68217f6ef9a9afe7575e766bd7b9f" : "Planner Code",
62   "76d5bf9597c882d6513f71759df298d5" : "Displaying parts {0} - {1} of {2}",
63   "3601146c4e948c32b6424d2c0a7f0118" : "Price",
64   "1814d65a76028fdfbadab64a5a8076df" : "Suppliers",
65   "90e4ac2e5a22e53df63b6b186d8727ba" : "No Events found",
66   "4ee972120bcda675f75222c87cb9d356" : "Who",
67   "16d2b386b2034b9488996466aaae0b57" : "History",
68   "14fc4f0a5008e1d8d5645071755c596b" : "Price UOM",
69   "089ba2b5edc96565fc22c584ecfbb1a6" : "Displaying events{0} - {1} of {2}",
70   "b5a7adde1af5c87d7fd797b6245c2a39" : "Description",
71   "148cb4c3e6469c6a92d24951485b65ff" : "Item listprice",
72   "c96bc98500430b5eb8e9cfc5959e09b5" : "Item sold",
73   "7f841b4d2f7280eb82318988c6d649d1" : "Displaying itemsrc{0} - {1} of {2}",
74   "a254c25adc7d10d7e9c4889484f875a5" : "Detail",
75   "5aa275a71868f3afcacfd6de452b07eb" : "Costcat",
76   "c0ed345ec857c06b31f7e88745c9bc40" : "Displaying Images  {0} - {1} of {2}",
77   "c9cc8cce247e49bae79f15173ce97354" : "Save",
78   "6abc7326bcd435c1eb22ad3714db48c4" : "Lead time (Days)",
79   "ec9ceefe0c19f4c029008c23e3c947b7" : "Vendor",
80   "4d3d769b812b6faa6b76e1a8abaece2d" : "Active",
81   "004bf6c9a40003140292e97330236c53" : "Action",
82   "689202409e48743b914713f96d93947c" : "Value",
83   "f4c6f851b00d5518bf888815de279aba" : "Notes",
84   "10991ea03e3591bebc4c0827fc369540" : "Product Category",
85   "f9838de820f2a2e16241033270c68e29" : "Select uom",
86   "8c489d0946f66d17d73f26366a4bf620" : "Weight",
87   "d85a8a381c36f6dde21d81542830e2b1" : "Sold",
88   "1063e38cb53d94d386f21227fcd84717" : "Remove",
89   "7996af9149ed376ce252e35c4da7146b" : "Select Vendor"
90  },
91  "items" : [
92   {
93    "listeners" : {
94     "show" : "function (_self)\n{\n     _this.dialog.layout.getRegion('center').showPanel(0);\n}"
95    },
96    "modal" : true,
97    "collapsible" : false,
98    "title" : "Edit / Create item",
99    "xtype" : "LayoutDialog",
100    "width" : 800,
101    "$ xns" : "Roo",
102    "closable" : false,
103    "resizable" : false,
104    "height" : 550,
105    "items" : [
106     {
107      "alwaysShowTabs" : true,
108      "xtype" : "LayoutRegion",
109      "tabPosition" : "top",
110      "$ xns" : "Roo",
111      "* prop" : "center"
112     },
113     {
114      "region" : "center",
115      "title" : "Detail",
116      "xtype" : "ContentPanel",
117      "$ xns" : "Roo",
118      "items" : [
119       {
120        "listeners" : {
121         "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       _this.form.findField('item_number').el.dom.readOnly = true;\n       _this.form.findField('item_type').disabled = true; \n       \n       if(_this.data.item_id * 1 > 0){\n            \n            this.load({ \n                method: 'GET', \n                params: {\n                     '_id' : _this.data.item_id,\n                     '_with_itemsite' : 1,\n                     '_with_itemcost' : 1,\n                     '_with_prodcat' : 1 ,\n                     '_with_salesaccnt' : 1 \n                }\n            });\n            return;\n       }\n       // if it's new..\n       _this.form.findField('item_number').el.dom.readOnly = false;\n       _this.form.findField('item_type').disabled = false; \n       _this.form.findField('item_salesaccnt').setValue('');\n       \n       _this.form.findField('item_type').showHide();\n       \n       return;\n    }\n    if (action.type == 'load') {\n       _this.form.findField('item_type').showHide();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        var id = _this.form.findField('item_id').getValue() * 1;\n        if (id < 1) {\n        \n            this.load({ \n                method: 'GET', \n                params: {\n                     '_id' : action.result.data.item_id,\n                     '_with_itemsite' : 1,\n                     '_with_itemcost' : 1,\n                     '_with_prodcat' : 1 ,\n                     '_with_salesaccnt' : 1 \n                }\n            });\n            return;\n        }\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
122         "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
123        },
124        "$ url" : "baseURL + '/Roo/item.php'",
125        "method" : "POST",
126        "style" : "margin:10px;",
127        "xtype" : "Form",
128        "labelWidth" : 120,
129        "$ xns" : "Roo.form",
130        "items" : [
131         {
132          "fieldLabel" : "SKU",
133          "xtype" : "TextField",
134          "allowBlank" : false,
135          "width" : 200,
136          "$ xns" : "Roo.form",
137          "name" : "item_number"
138         },
139         {
140          "fieldLabel" : "Description",
141          "xtype" : "TextField",
142          "width" : 400,
143          "$ xns" : "Roo.form",
144          "name" : "item_descrip1"
145         },
146         {
147          "fieldLabel" : "Description (2)",
148          "xtype" : "TextField",
149          "width" : 400,
150          "$ xns" : "Roo.form",
151          "name" : "item_descrip2"
152         },
153         {
154          "xtype" : "Column",
155          "labelWidth" : 120,
156          "$ xns" : "Roo.form",
157          "items" : [
158           {
159            "listeners" : {
160             "beforeselect" : "function (combo, record, index)\n{\n    (function() { combo.showHide(); }).defer(100);\n}"
161            },
162            "listWidth" : 200,
163            "triggerAction" : "all",
164            "fieldLabel" : "Type",
165            "displayField" : "fname",
166            "emptyText" : "Select Type",
167            "hiddenName" : "item_type",
168            "valueField" : "ftype",
169            "xtype" : "ComboBox",
170            "allowBlank" : false,
171            "$ showHide" : "function() {\n\n    var it = this.getValue();\n    \n    var options = [ \n        'item_itemcost_id_itemcost_curr_id',\n        'item_itemcost_id_itemcost_actcost',\n        'item_itemsite_id_itemsite_reorderlevel',\n        'item_itemsite_id_itemsite_leadtime',\n        'item_itemsite_id_itemsite_location_id',\n        'item_itemsite_id_itemsite_loccntrl',\n        'item_itemsite_id_itemsite_stocked',\n        'item_itemsite_id_itemsite_perishable',\n        \n        'item_itemsite_id_itemsite_safetystock',\n        'item_itemsite_id_itemsite_controlmethod',\n        'item_itemsite_id_itemsite_plancode_id',\n        'item_itemsite_id_itemsite_costcat_id',\n        'item_itemsite_id_itemsite_active',\n        'item_itemsite_id_itemsite_sold'\n        \n    ];\n    \n    var r_req = [ \n        'item_listprice'\n    ];\n    \n    var state = true;\n    \n    _this.standardCostFieldSet.show();\n    _this.itemsiteFieldSet.show();\n\n    \n    switch(it) {\n        case 'K':\n            state = false;\n\n            _this.form.findField('item_listprice').allowBlank = false;\n            _this.form.findField('item_listprice').actionMode = 'fieldEl';\n            _this.form.findField('item_listprice').hideMode = 'display';\n            _this.form.findField('item_listprice').show();\n                        \n            break;\n            \n        case 'R': // refrence\n            options = options.concat(r_req);\n            state = false;\n            _this.standardCostFieldSet.hide();\n            break;\n            \n        case 'P': // purchased..\n            options = options.concat(r_req);\n            // must have\n            break;\n    }\n    \n    Roo.each(options, function(n) {\n        var ff = _this.form.findField(n);\n        ff.allowBlank = !state;\n        ff.actionMode = 'fieldEl';\n        ff.hideMode = 'display';\n        state ? ff.show() : ff.hide(); \n        \n    });\n    \n    \n    if(!state){\n        _this.standardCostFieldSet.hide();\n        _this.itemsiteFieldSet.hide();\n\n    }\n    \n  \n           \n}\n",
172            "editable" : false,
173            "width" : 200,
174            "$ xns" : "Roo.form",
175            "mode" : "local",
176            "name" : "item_type_name",
177            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
178            "items" : [
179             {
180              "xtype" : "SimpleStore",
181              "$ data" : "[ \n    [ 'P', \"Purchased (eg. a standard product)\"],\n    [ 'R' , \"Reference (Non-Product)\"],\n    [ 'K', \"Kit (made up of products)\"]  \n]\n",
182              "$ fields" : "[  'ftype', 'fname']",
183              "$ xns" : "Roo.data",
184              "* prop" : "store"
185             }
186            ]
187           },
188           {
189            "listWidth" : 400,
190            "triggerAction" : "all",
191            "fieldLabel" : "Class",
192            "forceSelection" : true,
193            "selectOnFocus" : true,
194            "pageSize" : 20,
195            "displayField" : "classcode_code",
196            "emptyText" : "Select classcode",
197            "hiddenName" : "item_classcode_id",
198            "minChars" : 2,
199            "valueField" : "classcode_id",
200            "xtype" : "ComboBox",
201            "allowBlank" : false,
202            "typeAhead" : true,
203            "editable" : false,
204            "width" : 200,
205            "$ xns" : "Roo.form",
206            "name" : "item_classcode_id_classcode_code",
207            "qtip" : "Select classcode",
208            "queryParam" : "",
209            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{classcode_code}</b> </div>",
210            "loadingText" : "Searching...",
211            "items" : [
212             {
213              "listeners" : {
214               "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
215              },
216              "xtype" : "Store",
217              "remoteSort" : true,
218              "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
219              "$ xns" : "Roo.data",
220              "* prop" : "store",
221              "items" : [
222               {
223                "$ url" : "baseURL + '/Roo/classcode.php'",
224                "method" : "GET",
225                "xtype" : "HttpProxy",
226                "$ xns" : "Roo.data",
227                "* prop" : "proxy"
228               },
229               {
230                "id" : "id",
231                "root" : "data",
232                "xtype" : "JsonReader",
233                "$ xns" : "Roo.data",
234                "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"classcode_code\",\"type\":\"string\"}]",
235                "* prop" : "reader",
236                "totalProperty" : "total"
237               }
238              ]
239             }
240            ]
241           },
242           {
243            "listWidth" : 400,
244            "triggerAction" : "all",
245            "fieldLabel" : "Invoice UOM",
246            "forceSelection" : true,
247            "selectOnFocus" : true,
248            "pageSize" : 20,
249            "displayField" : "uom_descrip",
250            "emptyText" : "Select uom",
251            "hiddenName" : "item_inv_uom_id",
252            "minChars" : 2,
253            "valueField" : "uom_id",
254            "xtype" : "ComboBox",
255            "allowBlank" : false,
256            "typeAhead" : true,
257            "editable" : false,
258            "width" : 200,
259            "$ xns" : "Roo.form",
260            "name" : "item_inv_uom_id_uom_descrip",
261            "qtip" : "Select classcode",
262            "queryParam" : "",
263            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>",
264            "loadingText" : "Searching...",
265            "items" : [
266             {
267              "listeners" : {
268               "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
269              },
270              "xtype" : "Store",
271              "remoteSort" : true,
272              "$ sortInfo" : "{ direction : 'ASC', field: 'uom_name' }",
273              "$ xns" : "Roo.data",
274              "* prop" : "store",
275              "items" : [
276               {
277                "$ url" : "baseURL + '/Roo/uom.php'",
278                "method" : "GET",
279                "xtype" : "HttpProxy",
280                "$ xns" : "Roo.data",
281                "* prop" : "proxy"
282               },
283               {
284                "id" : "id",
285                "root" : "data",
286                "xtype" : "JsonReader",
287                "$ xns" : "Roo.data",
288                "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"uom_name\",\"type\":\"string\"},\n    {\"name\":\"uom_descrip\",\"type\":\"string\"},\n]",
289                "* prop" : "reader",
290                "totalProperty" : "total"
291               }
292              ]
293             }
294            ]
295           },
296           {
297            "listWidth" : 400,
298            "triggerAction" : "all",
299            "fieldLabel" : "Price UOM",
300            "forceSelection" : true,
301            "selectOnFocus" : true,
302            "pageSize" : 20,
303            "displayField" : "uom_descrip",
304            "emptyText" : "Select uom",
305            "hiddenName" : "item_price_uom_id",
306            "minChars" : 2,
307            "valueField" : "uom_id",
308            "xtype" : "ComboBox",
309            "allowBlank" : false,
310            "typeAhead" : true,
311            "editable" : false,
312            "width" : 200,
313            "$ xns" : "Roo.form",
314            "name" : "item_price_uom_id_uom_descrip",
315            "qtip" : "Select classcode",
316            "queryParam" : "",
317            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>",
318            "loadingText" : "Searching...",
319            "items" : [
320             {
321              "listeners" : {
322               "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
323              },
324              "xtype" : "Store",
325              "remoteSort" : true,
326              "$ sortInfo" : "{ direction : 'ASC', field: 'uom_name' }",
327              "$ xns" : "Roo.data",
328              "* prop" : "store",
329              "items" : [
330               {
331                "$ url" : "baseURL + '/Roo/uom.php'",
332                "xtype" : "HttpProxy",
333                "method" : "GET",
334                "$ xns" : "Roo.data",
335                "* prop" : "proxy"
336               },
337               {
338                "id" : "id",
339                "root" : "data",
340                "xtype" : "JsonReader",
341                "$ xns" : "Roo.data",
342                "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"uom_name\",\"type\":\"string\"},\n    {\"name\":\"uom_descrip\",\"type\":\"string\"},\n]",
343                "* prop" : "reader",
344                "totalProperty" : "total"
345               }
346              ]
347             }
348            ]
349           },
350           {
351            "fieldLabel" : "Weight",
352            "xtype" : "NumberField",
353            "allowBlank" : false,
354            "allowDecimals" : true,
355            "decimalPrecision" : 2,
356            "width" : 200,
357            "$ xns" : "Roo.form",
358            "name" : "item_prodweight"
359           },
360           {
361            "fieldLabel" : "Item comments",
362            "xtype" : "TextArea",
363            "width" : 200,
364            "$ xns" : "Roo.form",
365            "name" : "item_comments",
366            "height" : 100
367           },
368           {
369            "fieldLabel" : "Item sold",
370            "inputValue" : true,
371            "xtype" : "Checkbox",
372            "valueOff" : 0,
373            "width" : 75,
374            "$ xns" : "Roo.form",
375            "name" : "item_sold"
376           },
377           {
378            "fieldLabel" : "Item active",
379            "inputValue" : true,
380            "xtype" : "Checkbox",
381            "valueOff" : 0,
382            "width" : 75,
383            "$ xns" : "Roo.form",
384            "name" : "item_active"
385           },
386           {
387            "listeners" : {
388             "add" : "function (combo)\n{\n    Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});\n}",
389             "edit" : "function (combo, record)\n{\n    var s = _this.form.findField('item_prodcat_id').getValue() * 1;\n    if(s < 1){\n        Roo.MessageBox.alert('Error','Please select a account assignment');\n        return;\n    }\n    Pman.Dialog.XtupleProdcat.show({prodcat_id : s});\n}"
390            },
391            "alwaysQuery" : true,
392            "listWidth" : 400,
393            "triggerAction" : "all",
394            "fieldLabel" : "Product Category",
395            "forceSelection" : true,
396            "selectOnFocus" : true,
397            "pageSize" : 20,
398            "displayField" : "prodcat_code",
399            "emptyText" : "Select Category",
400            "hiddenName" : "item_prodcat_id",
401            "minChars" : 2,
402            "valueField" : "prodcat_id",
403            "xtype" : "ComboBox",
404            "allowBlank" : false,
405            "typeAhead" : true,
406            "editable" : false,
407            "width" : 200,
408            "$ xns" : "Roo.form",
409            "name" : "item_prodcat_id_prodcat_code",
410            "qtip" : "Select prodcat",
411            "queryParam" : "",
412            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{prodcat_code}</b> </div>",
413            "loadingText" : "Searching...",
414            "items" : [
415             {
416              "listeners" : {
417               "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
418              },
419              "xtype" : "Store",
420              "remoteSort" : true,
421              "$ xns" : "Roo.data",
422              "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
423              "* prop" : "store",
424              "items" : [
425               {
426                "$ url" : "baseURL + '/Roo/prodcat.php'",
427                "xtype" : "HttpProxy",
428                "method" : "GET",
429                "$ xns" : "Roo.data",
430                "* prop" : "proxy"
431               },
432               {
433                "id" : "id",
434                "root" : "data",
435                "xtype" : "JsonReader",
436                "$ xns" : "Roo.data",
437                "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"prodcat_code\",\"type\":\"string\"}]",
438                "* prop" : "reader",
439                "totalProperty" : "total"
440               }
441              ]
442             }
443            ]
444           },
445           {
446            "fieldLabel" : "Sales Account",
447            "xtype" : "DisplayField",
448            "$ xns" : "Roo.form",
449            "name" : "item_salesaccnt"
450           },
451           {
452            "fieldLabel" : "Item listprice",
453            "xtype" : "NumberField",
454            "width" : 200,
455            "$ xns" : "Roo.form",
456            "name" : "item_listprice"
457           },
458           {
459            "listeners" : {
460             "render" : "function (_self)\n{\n    _this.standardCostFieldSet = _self;\n}"
461            },
462            "xtype" : "FieldSet",
463            "legend" : "Standard Cost",
464            "style" : "width:320px",
465            "$ xns" : "Roo.form",
466            "items" : [
467             {
468              "listWidth" : 400,
469              "triggerAction" : "all",
470              "fieldLabel" : "Currency",
471              "forceSelection" : true,
472              "selectOnFocus" : true,
473              "pageSize" : 20,
474              "displayField" : "curr_name",
475              "emptyText" : "Select Currency",
476              "hiddenName" : "item_itemcost_id_itemcost_curr_id",
477              "minChars" : 2,
478              "valueField" : "curr_id",
479              "xtype" : "ComboBox",
480              "allowBlank" : false,
481              "typeAhead" : true,
482              "editable" : false,
483              "width" : 200,
484              "$ xns" : "Roo.form",
485              "name" : "curr_name",
486              "qtip" : "Select Currency",
487              "queryParam" : "query[curr_name]",
488              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
489              "loadingText" : "Searching...",
490              "items" : [
491               {
492                "listeners" : {
493                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n   \n}\n"
494                },
495                "xtype" : "Store",
496                "remoteSort" : true,
497                "$ sortInfo" : "{ direction : 'ASC', field: 'curr_symbol' }",
498                "$ xns" : "Roo.data",
499                "* prop" : "store",
500                "items" : [
501                 {
502                  "$ url" : "baseURL + '/Roo/curr_symbol.php'",
503                  "xtype" : "HttpProxy",
504                  "method" : "GET",
505                  "$ xns" : "Roo.data",
506                  "* prop" : "proxy"
507                 },
508                 {
509                  "id" : "curr_id",
510                  "root" : "data",
511                  "xtype" : "JsonReader",
512                  "$ xns" : "Roo.data",
513                  "$ fields" : "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]",
514                  "* prop" : "reader",
515                  "totalProperty" : "total"
516                 }
517                ]
518               }
519              ]
520             },
521             {
522              "fieldLabel" : "Value",
523              "xtype" : "NumberField",
524              "allowBlank" : false,
525              "width" : 200,
526              "$ xns" : "Roo.form",
527              "name" : "item_itemcost_id_itemcost_actcost"
528             }
529            ]
530           }
531          ]
532         },
533         {
534          "xtype" : "Column",
535          "$ xns" : "Roo.form",
536          "items" : [
537           {
538            "listeners" : {
539             "render" : "function (_self)\n{\n    _this.itemsiteFieldSet = _self;\n}"
540            },
541            "xtype" : "FieldSet",
542            "legend" : "Itemsite Settings",
543            "$ xns" : "Roo.form",
544            "String/Object/Function style" : "width:335px;",
545            "Number labelWidth" : 120,
546            "items" : [
547             {
548              "fieldLabel" : "Reorder Level",
549              "xtype" : "NumberField",
550              "allowBlank" : false,
551              "width" : 200,
552              "$ xns" : "Roo.form",
553              "name" : "item_itemsite_id_itemsite_reorderlevel"
554             },
555             {
556              "fieldLabel" : "Stock Safety Level",
557              "xtype" : "NumberField",
558              "allowBlank" : false,
559              "width" : 200,
560              "$ xns" : "Roo.form",
561              "name" : "item_itemsite_id_itemsite_safetystock"
562             },
563             {
564              "fieldLabel" : "Lead time (Days)",
565              "xtype" : "NumberField",
566              "allowBlank" : false,
567              "width" : 200,
568              "$ xns" : "Roo.form",
569              "name" : "item_itemsite_id_itemsite_leadtime"
570             },
571             {
572              "listWidth" : 200,
573              "triggerAction" : "all",
574              "fieldLabel" : "Control Method",
575              "displayField" : "fname",
576              "hiddenName" : "item_itemsite_id_itemsite_controlmethod",
577              "valueField" : "ftype",
578              "xtype" : "ComboBox",
579              "allowBlank" : false,
580              "editable" : false,
581              "width" : 200,
582              "$ xns" : "Roo.form",
583              "mode" : "local",
584              "name" : "item_itemsite_id_itemsite_controlmethod_name",
585              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
586              "items" : [
587               {
588                "xtype" : "SimpleStore",
589                "$ data" : "[ \n    [ 'N', \"None\"],\n    [ 'R' , \"Regular\"]\n]\n",
590                "$ fields" : "[  'ftype', 'fname']",
591                "$ xns" : "Roo.data",
592                "* prop" : "store"
593               }
594              ]
595             },
596             {
597              "listWidth" : 400,
598              "triggerAction" : "all",
599              "fieldLabel" : "Planner Code",
600              "forceSelection" : true,
601              "selectOnFocus" : true,
602              "pageSize" : 20,
603              "displayField" : "plancode_name",
604              "emptyText" : "Select plancode",
605              "hiddenName" : "item_itemsite_id_itemsite_plancode_id",
606              "minChars" : 2,
607              "valueField" : "plancode_id",
608              "xtype" : "ComboBox",
609              "allowBlank" : false,
610              "typeAhead" : true,
611              "editable" : false,
612              "width" : 200,
613              "$ xns" : "Roo.form",
614              "name" : "plancode_name",
615              "qtip" : "Select plancode",
616              "queryParam" : "",
617              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{plancode_name}</b> </div>",
618              "loadingText" : "Searching...",
619              "items" : [
620               {
621                "listeners" : {
622                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
623                },
624                "xtype" : "Store",
625                "remoteSort" : true,
626                "$ xns" : "Roo.data",
627                "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
628                "* prop" : "store",
629                "items" : [
630                 {
631                  "$ url" : "baseURL + '/Roo/plancode.php'",
632                  "xtype" : "HttpProxy",
633                  "method" : "GET",
634                  "$ xns" : "Roo.data",
635                  "* prop" : "proxy"
636                 },
637                 {
638                  "id" : "id",
639                  "root" : "data",
640                  "xtype" : "JsonReader",
641                  "$ xns" : "Roo.data",
642                  "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"plancode_code\",\"type\":\"string\"}]",
643                  "* prop" : "reader",
644                  "totalProperty" : "total"
645                 }
646                ]
647               }
648              ]
649             },
650             {
651              "listWidth" : 400,
652              "triggerAction" : "all",
653              "fieldLabel" : "Costcat",
654              "forceSelection" : true,
655              "selectOnFocus" : true,
656              "pageSize" : 20,
657              "displayField" : "costcat_code",
658              "emptyText" : "Select costcat",
659              "hiddenName" : "item_itemsite_id_itemsite_costcat_id",
660              "minChars" : 2,
661              "valueField" : "costcat_id",
662              "xtype" : "ComboBox",
663              "allowBlank" : false,
664              "typeAhead" : true,
665              "editable" : false,
666              "width" : 200,
667              "$ xns" : "Roo.form",
668              "name" : "costcat_code",
669              "qtip" : "Select costcat",
670              "queryParam" : "",
671              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{costcat_code}</b> </div>",
672              "loadingText" : "Searching...",
673              "items" : [
674               {
675                "listeners" : {
676                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
677                },
678                "xtype" : "Store",
679                "remoteSort" : true,
680                "$ xns" : "Roo.data",
681                "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
682                "* prop" : "store",
683                "items" : [
684                 {
685                  "$ url" : "baseURL + '/Roo/costcat.php'",
686                  "xtype" : "HttpProxy",
687                  "method" : "GET",
688                  "$ xns" : "Roo.data",
689                  "* prop" : "proxy"
690                 },
691                 {
692                  "id" : "id",
693                  "root" : "data",
694                  "xtype" : "JsonReader",
695                  "$ xns" : "Roo.data",
696                  "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"costcat_code\",\"type\":\"string\"}]",
697                  "* prop" : "reader",
698                  "totalProperty" : "total"
699                 }
700                ]
701               }
702              ]
703             },
704             {
705              "fieldLabel" : "Active",
706              "inputValue" : true,
707              "xtype" : "Checkbox",
708              "valueOff" : 0,
709              "width" : 75,
710              "$ xns" : "Roo.form",
711              "name" : "item_itemsite_id_itemsite_active"
712             },
713             {
714              "fieldLabel" : "Sold",
715              "inputValue" : true,
716              "xtype" : "Checkbox",
717              "valueOff" : 0,
718              "width" : 75,
719              "$ xns" : "Roo.form",
720              "name" : "item_itemsite_id_itemsite_sold"
721             },
722             {
723              "fieldLabel" : "Stocked",
724              "inputValue" : true,
725              "xtype" : "Checkbox",
726              "valueOff" : 0,
727              "width" : 75,
728              "$ xns" : "Roo.form",
729              "name" : "item_itemsite_id_itemsite_stocked"
730             },
731             {
732              "fieldLabel" : "Perishable",
733              "inputValue" : true,
734              "xtype" : "Checkbox",
735              "valueOff" : 0,
736              "width" : 75,
737              "$ xns" : "Roo.form",
738              "name" : "item_itemsite_id_itemsite_perishable"
739             },
740             {
741              "fieldLabel" : "Multi Location",
742              "inputValue" : true,
743              "xtype" : "Checkbox",
744              "valueOff" : 0,
745              "width" : 100,
746              "$ xns" : "Roo.form",
747              "name" : "item_itemsite_id_itemsite_loccntrl"
748             },
749             {
750              "listWidth" : 400,
751              "triggerAction" : "all",
752              "fieldLabel" : "Default Location",
753              "forceSelection" : true,
754              "selectOnFocus" : true,
755              "pageSize" : 200,
756              "displayField" : "location_name",
757              "emptyText" : "Default Location",
758              "hiddenName" : "item_itemsite_id_itemsite_location_id",
759              "minChars" : 2,
760              "valueField" : "location_id",
761              "xtype" : "ComboBox",
762              "allowBlank" : false,
763              "typeAhead" : false,
764              "editable" : true,
765              "width" : 200,
766              "$ xns" : "Roo.form",
767              "name" : "location_name",
768              "qtip" : "Select terms",
769              "queryParam" : "query[location_name]",
770              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
771              "loadingText" : "Searching...",
772              "items" : [
773               {
774                "listeners" : {
775                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n     o.params.location_netable = 1;\n     o.params._notinternalcompany = 1;\n     o.params.location_restrict = 0;\n}\n"
776                },
777                "xtype" : "Store",
778                "remoteSort" : true,
779                "$ sortInfo" : "{ direction : 'ASC', field: 'location_name' }",
780                "$ xns" : "Roo.data",
781                "* prop" : "store",
782                "items" : [
783                 {
784                  "$ url" : "baseURL + '/Roo/location.php'",
785                  "method" : "GET",
786                  "xtype" : "HttpProxy",
787                  "$ xns" : "Roo.data",
788                  "* prop" : "proxy"
789                 },
790                 {
791                  "id" : "location_id",
792                  "root" : "data",
793                  "xtype" : "JsonReader",
794                  "$ fields" : "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]",
795                  "$ xns" : "Roo.data",
796                  "* prop" : "reader",
797                  "totalProperty" : "total"
798                 }
799                ]
800               }
801              ]
802             }
803            ]
804           }
805          ]
806         },
807         {
808          "xtype" : "Hidden",
809          "$ xns" : "Roo.form",
810          "width" : 75,
811          "name" : "item_id"
812         }
813        ]
814       }
815      ]
816     },
817     {
818      "listeners" : {
819       "|activate" : "function() {\n    _this.partspanel = this;\n    \n    try { if (MODULE.isBuilder) {\n        return;\n    } } catch(e) { }\n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if (id < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding parts\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    var type = _this.form.findField('item_type').getValue();\n    \n    if(!type.length || type != 'K'){\n        Roo.MessageBox.alert(\"Error\", \"Can't add parts to non-kit item\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    if (_this.partsgrid) {\n        _this.partsgrid.footer.onClick('first');\n    \n     }\n}"
820      },
821      "region" : "center",
822      "fitToframe" : true,
823      "background" : true,
824      "title" : "Item Parts",
825      "xtype" : "GridPanel",
826      "fitContainer" : true,
827      "$ xns" : "Roo",
828      "tableName" : "bomitem",
829      "items" : [
830       {
831        "listeners" : {
832         "beforeedit" : "function (e)\n{\n    if(e.field != 'bomitem_qtyper'){\n        return false;\n    }\n    \n}",
833         "|render" : "function() \n{\n    _this.partsgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.partspanel.active) {\n       this.footer.onClick('first');\n    }\n}",
834         "afteredit" : "function (e)\n{\n    if(e.originalValue == e.value){\n        return false;\n    }\n    \n    \n    new Pman.Request({\n        method : 'POST',\n        url : baseURL + '/Roo/bomitem.php',\n        mask : 'Saving',\n        params : {\n            bomitem_id : e.record.data.bomitem_id,\n            bomitem_qtyper : e.value\n        },\n        success : function() {\n            e.record.set('bomitem_qtyper', e.value);\n        }\n    \n    });\n        \n         \n        \n        \n}"
835        },
836        "autoExpandColumn" : "bomitem_item_id_item_descrip1",
837        "xtype" : "EditorGrid",
838        "loadMask" : true,
839        "clicksToEdit" : 1,
840        "$ xns" : "Roo.grid",
841        "* prop" : "grid",
842        "items" : [
843         {
844          "xtype" : "Toolbar",
845          "$ xns" : "Roo",
846          "* prop" : "toolbar",
847          "items" : [
848           {
849            "listeners" : {
850             "render" : "function (_self)\n{\n    _this.partsBox = _self;\n}",
851             "select" : "function (combo, record, index)\n{\n    var item_id = _this.form.findField('item_id').getValue() * 1;\n    \n    if(typeof(record) == 'undefined' || !record || record.data.id * 1 < 1 || item_id < 1){\n        return;\n    }\n    \n    var err = false;\n\n    _this.partsgrid.ds.each(function(d){\n        if(record.data.item_id == d.data.bomitem_item_id){\n            err = true;\n        }\n    });\n\n    if(err){\n        Roo.MessageBox.alert('Error', record.data.item_number + ' already exists!');\n        _this.partsBox.reset();\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/bomitem.php',\n        method : 'POST',\n        params : {\n            bomitem_parent_item_id : item_id,\n            bomitem_item_id : record.data.item_id,\n            bomitem_qtyper : 1\n        }, \n        success : function(res) {\n            _this.partsBox.reset();\n            _this.partsgrid.footer.onClick('first');\n        }\n    }); \n}"
852            },
853            "alwaysQuery" : true,
854            "triggerAction" : "all",
855            "fieldLabel" : "Item",
856            "forceSelection" : true,
857            "selectOnFocus" : true,
858            "pageSize" : 20,
859            "displayField" : "item_number",
860            "emptyText" : "Select item",
861            "minChars" : 2,
862            "valueField" : "id",
863            "xtype" : "ComboBox",
864            "allowBlank" : true,
865            "typeAhead" : true,
866            "editable" : true,
867            "width" : 200,
868            "$ xns" : "Roo.bootstrap",
869            "qtip" : "Select item",
870            "queryParam" : "query[number_or_name]",
871            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{item_number}</b> </div>",
872            "loadingText" : "Searching...",
873            "items" : [
874             {
875              "listeners" : {
876               "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params.item_active = 1;\n    o.params['!item_type'] = 'K';\n}\n"
877              },
878              "xtype" : "Store",
879              "remoteSort" : true,
880              "$ sortInfo" : "{ direction : 'ASC', field: 'item_number' }",
881              "$ xns" : "Roo.data",
882              "* prop" : "store",
883              "items" : [
884               {
885                "$ url" : "baseURL + '/Roo/item.php'",
886                "method" : "GET",
887                "xtype" : "HttpProxy",
888                "$ xns" : "Roo.data",
889                "* prop" : "proxy"
890               },
891               {
892                "id" : "id",
893                "root" : "data",
894                "xtype" : "JsonReader",
895                "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"item_number\",\"type\":\"string\"}\n]",
896                "$ xns" : "Roo.data",
897                "* prop" : "reader",
898                "totalProperty" : "total"
899               }
900              ]
901             }
902            ]
903           },
904           {
905            "xtype" : "Fill",
906            "$ xns" : "Roo.Toolbar"
907           },
908           {
909            "listeners" : {
910             "|click" : "function ()\n{\n    var sel = _this.partsgrid.getSelectionModel().getSelectedCell();\n    \n    if(!sel || !sel.length){\n        Roo.MessageBox.alert(\"Error\", \"Please select a item from below list\");\n        return;\n    }\n    \n    var d = _this.partsgrid.ds.getAt(sel[0]);      \n  \n    if(d.data.bomitem_id * 1 < 1){\n        Roo.MessageBox.alert(\"Error\", \"Invaild selection\");\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/bomitem.php',\n        method : 'POST',\n        params : {\n            _delete : d.data.bomitem_id\n        }, \n        success : function(res) {\n            _this.partsgrid.footer.onClick('first');\n        }\n    }); \n   \n}"
911            },
912            "text" : "Remove",
913            "xtype" : "Button",
914            "cls" : "x-btn-text-icon",
915            "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
916            "$ xns" : "Roo"
917           }
918          ]
919         },
920         {
921          "listeners" : {
922           "beforeload" : "function (_self, o)\n{\n   o.params = o.params || {};\n   \n   var id  = _this.form.findField('item_id').getValue() * 1;\n   if(id < 1){\n        return false;\n   }\n   \n   o.params.bom_parent_item_id = id;\n}"
923          },
924          "xtype" : "Store",
925          "remoteSort" : true,
926          "$ sortInfo" : "{ field : 'bomitem_item_id_item_name', direction: 'ASC' }",
927          "$ xns" : "Roo.data",
928          "* prop" : "dataSource",
929          "items" : [
930           {
931            "$ url" : "baseURL + '/Roo/bomitem.php'",
932            "xtype" : "HttpProxy",
933            "method" : "GET",
934            "$ xns" : "Roo.data",
935            "* prop" : "proxy"
936           },
937           {
938            "id" : "bom_id",
939            "root" : "data",
940            "xtype" : "JsonReader",
941            "$ fields" : "[\n    {\n        'name': 'bomitem_id',\n        'type': 'int'\n    }\n]",
942            "$ xns" : "Roo.data",
943            "* prop" : "reader",
944            "totalProperty" : "total"
945           }
946          ]
947         },
948         {
949          "pageSize" : 50,
950          "xtype" : "PagingToolbar",
951          "emptyMsg" : "Nothing found",
952          "$ xns" : "Roo",
953          "displayMsg" : "Displaying parts {0} - {1} of {2}",
954          "displayInfo" : true,
955          "* prop" : "footer"
956         },
957         {
958          "xtype" : "ColumnModel",
959          "header" : "Name",
960          "width" : 150,
961          "$ renderer" : "function(v) { return String.format('{0}', v); }",
962          "$ xns" : "Roo.grid",
963          "* prop" : "colModel[]",
964          "dataIndex" : "bomitem_item_id_item_number"
965         },
966         {
967          "xtype" : "ColumnModel",
968          "header" : "Description",
969          "width" : 150,
970          "$ renderer" : "function(v) { return String.format('{0}', v); }",
971          "$ xns" : "Roo.grid",
972          "* prop" : "colModel[]",
973          "dataIndex" : "bomitem_item_id_item_descrip1"
974         },
975         {
976          "xtype" : "ColumnModel",
977          "String align" : "right",
978          "header" : "Qty",
979          "width" : 100,
980          "$ renderer" : "function(v) { return String.format('{0}', v); }",
981          "$ xns" : "Roo.grid",
982          "* prop" : "colModel[]",
983          "dataIndex" : "bomitem_qtyper",
984          "items" : [
985           {
986            "xtype" : "GridEditor",
987            "$ xns" : "Roo.grid",
988            "* prop" : "editor",
989            "items" : [
990             {
991              "Boolean allowBlank" : false,
992              "String cls" : "align-right",
993              "xtype" : "NumberField",
994              "Number decimalPrecision" : 0,
995              "$ xns" : "Roo.form",
996              "* prop" : "field",
997              "Number minValue" : 0
998             }
999            ]
1000           }
1001          ]
1002         }
1003        ]
1004       }
1005      ]
1006     },
1007     {
1008      "listeners" : {
1009       "|activate" : "function() {\n    _this.panel = this;\n    \n    try { if (MODULE.isBuilder) {\n        return;\n    } } catch(e) { }\n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if (id < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding image\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    \n     }\n}"
1010      },
1011      "fitToframe" : true,
1012      "background" : true,
1013      "region" : "center",
1014      "title" : "Reference Files",
1015      "xtype" : "GridPanel",
1016      "fitContainer" : true,
1017      "$ xns" : "Roo",
1018      "tableName" : "Images",
1019      "items" : [
1020       {
1021        "listeners" : {
1022         "|rowdblclick" : "function (_self, rowIndex, e)\n{\n  \n   var s =  _self.getDataSource().getAt(rowIndex);\n   new Pman.Download({\n        url : baseURL + '/Images/Download/' + s.data.id\n    });\n   \n}",
1023         "|render" : "function() { \n    _this.grid = this; \n\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
1024        },
1025        "autoExpandColumn" : "id",
1026        "xtype" : "Grid",
1027        "loadMask" : true,
1028        "$ xns" : "Roo.grid",
1029        "* prop" : "grid",
1030        "items" : [
1031         {
1032          "listeners" : {
1033           "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    var id = _this.form.findField('item_id').getValue();\n    \n    if(id * 1 < 1){\n        return false;\n    }\n    \n    o.params.onid = id;\n    o.params.ontable = 'item';\n    \n}"
1034          },
1035          "xtype" : "Store",
1036          "remoteSort" : true,
1037          "$ sortInfo" : "{ field: 'created' , direction: 'DESC' }",
1038          "$ xns" : "Roo.data",
1039          "* prop" : "dataSource",
1040          "items" : [
1041           {
1042            "id" : "id",
1043            "root" : "data",
1044            "xtype" : "JsonReader",
1045            "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'filename',\n        'type': 'string'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'width',\n        'type': 'int'\n    },\n    {\n        'name': 'height',\n        'type': 'int'\n    },\n    {\n        'name': 'filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'date',\n        'dateFormat' : 'Y-m-d H:i:s'\n    },\n    {\n        'name': 'imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'descript',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    }\n]",
1046            "$ xns" : "Roo.data",
1047            "* prop" : "reader",
1048            "totalProperty" : "total"
1049           },
1050           {
1051            "$ url" : "baseURL + '/Roo/Images.php'",
1052            "xtype" : "HttpProxy",
1053            "method" : "GET",
1054            "$ xns" : "Roo.data",
1055            "* prop" : "proxy"
1056           }
1057          ]
1058         },
1059         {
1060          "pageSize" : 25,
1061          "xtype" : "PagingToolbar",
1062          "emptyMsg" : "No Images found",
1063          "$ xns" : "Roo",
1064          "displayInfo" : true,
1065          "displayMsg" : "Displaying Images  {0} - {1} of {2}",
1066          "* prop" : "footer"
1067         },
1068         {
1069          "xtype" : "Toolbar",
1070          "$ xns" : "Roo",
1071          "* prop" : "toolbar",
1072          "items" : [
1073           {
1074            "listeners" : {
1075             "|click" : "function()\n{\n    Pman.Dialog.Image.show({\n        id : 0, \n        ontable: 'item',\n        onid: _this.form.findField('item_id').getValue() * 1,\n        imgtype : ''\n    }, function(data){\n        if (!data) { return; } \n        _this.grid.footer.onClick('first');\n    }); \n\n}       "
1076            },
1077            "text" : "Add",
1078            "xtype" : "Button",
1079            "cls" : "x-btn-text-icon",
1080            "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
1081            "$ xns" : "Roo.Toolbar"
1082           },
1083           {
1084            "listeners" : {
1085             "|click" : "function()\n{\n    Pman.genericDelete(_this, 'Images'); \n}\n        "
1086            },
1087            "text" : "Delete",
1088            "xtype" : "Button",
1089            "cls" : "x-btn-text-icon",
1090            "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
1091            "$ xns" : "Roo.Toolbar"
1092           }
1093          ]
1094         },
1095         {
1096          "xtype" : "ColumnModel",
1097          "sortable" : true,
1098          "header" : "Created",
1099          "width" : 200,
1100          "$ renderer" : "function(v,x,r) {\n       return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',\n            v.format('d/M/Y'), r.data.mimetype, r.data.filename,\n    r.data.width, r.data.height\n    ); \n}\n     ",
1101          "$ xns" : "Roo.grid",
1102          "* prop" : "colModel[]",
1103          "dataIndex" : "created"
1104         },
1105         {
1106          "xtype" : "ColumnModel",
1107          "width" : 100,
1108          "header" : "Image",
1109          "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\" height=\"100\">', baseURL, v, r.data.filename); }",
1110          "$ xns" : "Roo.grid",
1111          "* prop" : "colModel[]",
1112          "dataIndex" : "id"
1113         }
1114        ]
1115       }
1116      ]
1117     },
1118     {
1119      "listeners" : {
1120       "|activate" : "function() {\n    _this.lpanel = this;\n    \n    try { if (MODULE.isBuilder) {\n        return;\n    } } catch(e) { }\n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if (id < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding image\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    if (_this.lgrid) {\n        _this.lgrid.footer.onClick('first');\n    \n     }\n}"
1121      },
1122      "fitToframe" : true,
1123      "background" : true,
1124      "region" : "center",
1125      "title" : "Price List",
1126      "xtype" : "GridPanel",
1127      "fitContainer" : true,
1128      "$ xns" : "Roo",
1129      "tableName" : "ipshead",
1130      "items" : [
1131       {
1132        "listeners" : {
1133         "beforeedit" : "function (e)\n{\n    if(e.field != 'ipshead_ipsitem_price'){\n        return false;\n    }\n    \n}",
1134         "|render" : "function() \n{\n    _this.lgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.lpanel.active) {\n       this.footer.onClick('first');\n    }\n}",
1135         "afteredit" : "function (e)\n{\n    if(e.originalValue == e.value){\n        return false;\n    }\n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if(id < 1){\n        return false;\n    }\n    \n    new Pman.Request({\n        method : 'POST',\n        url : baseURL + '/Roo/ipsiteminfo',\n        mask : 'Saving',\n        params : {\n            ipsitem_ipshead_id : e.record.data.ipshead_id,\n            ipsitem_item_id : id,\n            ipsitem_price : e.record.data.ipshead_ipsitem_price,\n            ipsitem_id : e.record.data.ipshead_ipsitem_id\n        }\n    \n    });\n        \n         \n        \n        \n}"
1136        },
1137        "autoExpandColumn" : "ipshead_descrip",
1138        "xtype" : "EditorGrid",
1139        "loadMask" : true,
1140        "clicksToEdit" : 1,
1141        "$ xns" : "Roo.grid",
1142        "* prop" : "grid",
1143        "items" : [
1144         {
1145          "listeners" : {
1146           "beforeload" : "function (_self, o)\n{\n   o.params = o.params || {};\n   \n   var id  = _this.form.findField('item_id').getValue() * 1;\n   if(id < 1){\n        return false;\n   }\n   \n   o.params._with_item = id;\n}"
1147          },
1148          "xtype" : "Store",
1149          "remoteSort" : true,
1150          "$ sortInfo" : "{ field : 'ipshead_id', direction: 'ASC' }",
1151          "$ xns" : "Roo.data",
1152          "* prop" : "dataSource",
1153          "items" : [
1154           {
1155            "$ url" : "baseURL + '/Roo/ipshead.php'",
1156            "method" : "GET",
1157            "xtype" : "HttpProxy",
1158            "$ xns" : "Roo.data",
1159            "* prop" : "proxy"
1160           },
1161           {
1162            "id" : "ipshead_id",
1163            "root" : "data",
1164            "xtype" : "JsonReader",
1165            "$ fields" : "[\n    {\n        'name': 'ipshead_id',\n        'type': 'int'\n    },\n    {\n        'name': 'ipshead_name',\n        'type': 'string'\n    }\n]",
1166            "$ xns" : "Roo.data",
1167            "* prop" : "reader",
1168            "totalProperty" : "total"
1169           }
1170          ]
1171         },
1172         {
1173          "pageSize" : 50,
1174          "xtype" : "PagingToolbar",
1175          "emptyMsg" : "Nothing found",
1176          "$ xns" : "Roo",
1177          "displayMsg" : "Displaying records {0} - {1} of {2}",
1178          "displayInfo" : true,
1179          "* prop" : "footer"
1180         },
1181         {
1182          "xtype" : "ColumnModel",
1183          "width" : 150,
1184          "header" : "Name",
1185          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1186          "$ xns" : "Roo.grid",
1187          "* prop" : "colModel[]",
1188          "dataIndex" : "ipshead_name"
1189         },
1190         {
1191          "xtype" : "ColumnModel",
1192          "width" : 150,
1193          "header" : "Description",
1194          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1195          "$ xns" : "Roo.grid",
1196          "* prop" : "colModel[]",
1197          "dataIndex" : "ipshead_descrip"
1198         },
1199         {
1200          "xtype" : "ColumnModel",
1201          "width" : 100,
1202          "header" : "Currency",
1203          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1204          "$ xns" : "Roo.grid",
1205          "* prop" : "colModel[]",
1206          "dataIndex" : "ipshead_curr_id_curr_name"
1207         },
1208         {
1209          "align" : "right",
1210          "xtype" : "ColumnModel",
1211          "header" : "Price",
1212          "width" : 120,
1213          "$ renderer" : "function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); }",
1214          "$ xns" : "Roo.grid",
1215          "* prop" : "colModel[]",
1216          "dataIndex" : "ipshead_ipsitem_price",
1217          "items" : [
1218           {
1219            "xtype" : "GridEditor",
1220            "$ xns" : "Roo.grid",
1221            "* prop" : "editor",
1222            "items" : [
1223             {
1224              "xtype" : "NumberField",
1225              "cls" : "align-right",
1226              "decimalPrecision" : 2,
1227              "$ xns" : "Roo.form",
1228              "* prop" : "field"
1229             }
1230            ]
1231           }
1232          ]
1233         }
1234        ]
1235       }
1236      ]
1237     },
1238     {
1239      "listeners" : {
1240       "|activate" : "function() {\n    _this.itemsrcpanel = this;\n    \n    try { if (MODULE.isBuilder) {\n        return;\n    } } catch(e) { }\n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if (id < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding suppliers\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return false;\n    }\n    \n    var type = _this.form.findField('item_type').getValue();\n    \n    if(type == 'K'){\n        Roo.MessageBox.alert(\"Error\", \"Can't add suppliers to kit item\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return false;\n    }\n    \n    if (_this.itemsrcgrid) {\n        _this.itemsrcgrid.footer.onClick('first');\n    }\n}"
1241      },
1242      "fitToframe" : true,
1243      "background" : true,
1244      "region" : "center",
1245      "title" : "Suppliers",
1246      "xtype" : "GridPanel",
1247      "fitContainer" : true,
1248      "$ xns" : "Roo",
1249      "tableName" : "itemsrc",
1250      "items" : [
1251       {
1252        "listeners" : {
1253         "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
1254         "|render" : "function() \n{\n    _this.itemsrcgrid = this; \n    \n    if (_this.itemsrcpanel.active) {\n       this.footer.onClick('first');\n    }\n}",
1255         "afteredit" : "function (e)\n{\n    e.record.commit();\n}"
1256        },
1257        "autoExpandColumn" : "itemsrc_comments",
1258        "xtype" : "EditorGrid",
1259        "loadMask" : true,
1260        "clicksToEdit" : 1,
1261        "$ xns" : "Roo.grid",
1262        "* prop" : "grid",
1263        "items" : [
1264         {
1265          "listeners" : {
1266           "update" : "function (_self, record, operation)\n{\n    Roo.log(operation);\n      Roo.log(record);\n   \n    if (operation != 'commit') {\n        return;\n    }\n    if (record.data.itemsrc_vend_id * 1 < 1) {\n        return; // do not save.\n    }\n    if (record.data.itemsrc_id * 1 < 0) {\n        return; // do not save. -- updating at present...\n    }\n    \n    var p = Roo.apply({}, record.data);\n    record.set('itemsrc_id', -1);    \n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Itemsrc',\n        params : p,\n        method : 'POST',\n        success: function(res) {\n            if (record.data.itemsrc_id *1  < 1) { \n                record.set('itemsrc_id', res.data.itemsrc_id);\n            }\n        }\n    });\n    \n    \n}",
1267           "beforeload" : "function (_self, o)\n{\n    \n    var id = 1 * _this.form.findField('item_id').getValue();\n    if (!id) {\n        this.removeAll();\n        return false;\n    }\n    o.params.itemsrc_item_id = id;\n}"
1268          },
1269          "xtype" : "Store",
1270          "remoteSort" : true,
1271          "$ sortInfo" : "{ field : 'itemsrc_vend_id_vend_name', direction: 'ASC' }",
1272          "$ xns" : "Roo.data",
1273          "* prop" : "dataSource",
1274          "items" : [
1275           {
1276            "$ url" : "baseURL + '/Roo/itemsrc.php'",
1277            "xtype" : "HttpProxy",
1278            "method" : "GET",
1279            "$ xns" : "Roo.data",
1280            "* prop" : "proxy"
1281           },
1282           {
1283            "id" : "id",
1284            "root" : "data",
1285            "xtype" : "JsonReader",
1286            "$ xns" : "Roo.data",
1287            "$ fields" : "[\n    {\n        'name': 'itemsrc_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_item_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_item_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_vend_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_vend_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_vend_item_number',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_vend_item_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_comments',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_vend_uom',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_invvendoruomratio',\n        'type': 'float'\n    },\n    {\n        'name': 'itemsrc_minordqty',\n        'type': 'float'\n    },\n    {\n        'name': 'itemsrc_multordqty',\n        'type': 'float'\n    },\n    {\n        'name': 'itemsrc_leadtime',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_ranking',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_active',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_manuf_name',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_manuf_item_number',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_manuf_item_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_default',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_upccode',\n        'type': 'string'\n    }\n]",
1288            "* prop" : "reader",
1289            "totalProperty" : "total"
1290           }
1291          ]
1292         },
1293         {
1294          "pageSize" : 25,
1295          "xtype" : "PagingToolbar",
1296          "emptyMsg" : "No itemsrc found",
1297          "$ xns" : "Roo",
1298          "displayInfo" : true,
1299          "displayMsg" : "Displaying itemsrc{0} - {1} of {2}",
1300          "* prop" : "footer"
1301         },
1302         {
1303          "xtype" : "Toolbar",
1304          "$ xns" : "Roo",
1305          "* prop" : "toolbar",
1306          "items" : [
1307           {
1308            "listeners" : {
1309             "|click" : "function()\n{\n     \n    Roo.log(\"add presed\");\n     \n    // work out last \n    var grid = _this.itemsrcgrid;\n     \n    // uses form defaults or last row value.\n    var nr = grid.ds.reader.newRow({\n         itemsrc_id : 0,\n         itemsrc_item_id : _this.form.findField('item_id').getValue(),\n         itemsrc_vend_id : 0,\n         itemsrc_vend_id_vend_name : '',\n         itemsrc_vend_item_number : '',\n         itemsrc_vend_item_descrip : '',\n         itemsrc_comments           : '',\n         itemsrc_vend_uom  :           'EA',\n         itemsrc_invvendoruomratio : 1.0,\n         itemsrc_minordqty        : 0,\n         itemsrc_multordqty        : 0,\n         itemsrc_leadtime         :  30,\n         itemsrc_ranking         :   0,\n         itemsrc_active          :   true,\n         itemsrc_manuf_name       :  '',\n         itemsrc_manuf_item_number : '',\n         itemsrc_manuf_item_descrip: '',\n         itemsrc_default          : true,\n         itemsrc_upccode    : ''\n                        \n    });\n    grid.stopEditing();\n    grid.ds.insert(0, nr); \n    grid.startEditing(0, 0); // type..\n\n}\n \n"
1310            },
1311            "text" : "Add",
1312            "xtype" : "Button",
1313            "cls" : "x-btn-text-icon",
1314            "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
1315            "$ xns" : "Roo.Toolbar"
1316           }
1317          ]
1318         },
1319         {
1320          "xtype" : "ColumnModel",
1321          "width" : 120,
1322          "header" : "Vendor",
1323          "$ renderer" : "function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); }",
1324          "$ xns" : "Roo.grid",
1325          "* prop" : "colModel[]",
1326          "dataIndex" : "itemsrc_vend_id",
1327          "items" : [
1328           {
1329            "xtype" : "GridEditor",
1330            "$ xns" : "Roo.grid",
1331            "* prop" : "editor",
1332            "items" : [
1333             {
1334              "listWidth" : 400,
1335              "triggerAction" : "all",
1336              "forceSelection" : true,
1337              "selectOnFocus" : true,
1338              "pageSize" : 20,
1339              "displayField" : "vend_name",
1340              "emptyText" : "Select Vendor",
1341              "hiddenName" : "itemsrc_vend_id",
1342              "minChars" : 2,
1343              "valueField" : "vend_id",
1344              "xtype" : "ComboBox",
1345              "allowBlank" : false,
1346              "typeAhead" : true,
1347              "editable" : true,
1348              "width" : 300,
1349              "$ xns" : "Roo.form",
1350              "* prop" : "field",
1351              "name" : "itemsrc_vend_id_vend_name",
1352              "qtip" : "Select vendinfo",
1353              "queryParam" : "q[search]",
1354              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>",
1355              "loadingText" : "Searching...",
1356              "items" : [
1357               {
1358                "listeners" : {
1359                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
1360                },
1361                "xtype" : "Store",
1362                "remoteSort" : true,
1363                "$ xns" : "Roo.data",
1364                "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
1365                "* prop" : "store",
1366                "items" : [
1367                 {
1368                  "$ url" : "baseURL + '/Roo/vendinfo.php'",
1369                  "xtype" : "HttpProxy",
1370                  "method" : "GET",
1371                  "$ xns" : "Roo.data",
1372                  "* prop" : "proxy"
1373                 },
1374                 {
1375                  "id" : "id",
1376                  "root" : "data",
1377                  "xtype" : "JsonReader",
1378                  "$ xns" : "Roo.data",
1379                  "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"vend_name\",\"type\":\"string\"}]",
1380                  "* prop" : "reader",
1381                  "totalProperty" : "total"
1382                 }
1383                ]
1384               }
1385              ]
1386             }
1387            ]
1388           }
1389          ]
1390         },
1391         {
1392          "xtype" : "ColumnModel",
1393          "width" : 100,
1394          "header" : "Vendor Ref#",
1395          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1396          "$ xns" : "Roo.grid",
1397          "* prop" : "colModel[]",
1398          "dataIndex" : "itemsrc_vend_item_number",
1399          "items" : [
1400           {
1401            "xtype" : "GridEditor",
1402            "$ xns" : "Roo.grid",
1403            "* prop" : "editor",
1404            "items" : [
1405             {
1406              "xtype" : "TextField",
1407              "$ xns" : "Roo.form",
1408              "* prop" : "field"
1409             }
1410            ]
1411           }
1412          ]
1413         },
1414         {
1415          "xtype" : "ColumnModel",
1416          "width" : 200,
1417          "header" : "Comments",
1418          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1419          "$ xns" : "Roo.grid",
1420          "* prop" : "colModel[]",
1421          "dataIndex" : "itemsrc_comments",
1422          "items" : [
1423           {
1424            "xtype" : "GridEditor",
1425            "$ xns" : "Roo.grid",
1426            "* prop" : "editor",
1427            "items" : [
1428             {
1429              "xtype" : "TextField",
1430              "$ xns" : "Roo.form",
1431              "* prop" : "field"
1432             }
1433            ]
1434           }
1435          ]
1436         },
1437         {
1438          "xtype" : "ColumnModel",
1439          "width" : 50,
1440          "header" : "UOM",
1441          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1442          "$ xns" : "Roo.grid",
1443          "* prop" : "colModel[]",
1444          "dataIndex" : "itemsrc_vend_uom"
1445         },
1446         {
1447          "align" : "right",
1448          "xtype" : "ColumnModel",
1449          "header" : "Min Qty",
1450          "width" : 50,
1451          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1452          "$ xns" : "Roo.grid",
1453          "* prop" : "colModel[]",
1454          "dataIndex" : "itemsrc_minordqty",
1455          "items" : [
1456           {
1457            "xtype" : "GridEditor",
1458            "$ xns" : "Roo.grid",
1459            "* prop" : "editor",
1460            "items" : [
1461             {
1462              "minValue" : 0,
1463              "xtype" : "NumberField",
1464              "decimalPrecision" : 0,
1465              "$ xns" : "Roo.form",
1466              "* prop" : "field"
1467             }
1468            ]
1469           }
1470          ]
1471         },
1472         {
1473          "align" : "right",
1474          "xtype" : "ColumnModel",
1475          "header" : "Lead time",
1476          "width" : 75,
1477          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1478          "$ xns" : "Roo.grid",
1479          "* prop" : "colModel[]",
1480          "dataIndex" : "itemsrc_leadtime",
1481          "items" : [
1482           {
1483            "xtype" : "GridEditor",
1484            "$ xns" : "Roo.grid",
1485            "* prop" : "editor",
1486            "items" : [
1487             {
1488              "minValue" : 0,
1489              "xtype" : "NumberField",
1490              "decimalPrecision" : 0,
1491              "$ xns" : "Roo.form",
1492              "* prop" : "field"
1493             }
1494            ]
1495           }
1496          ]
1497         },
1498         {
1499          "xtype" : "ColumnModel",
1500          "width" : 50,
1501          "header" : "Active",
1502          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1503          "$ xns" : "Roo.grid",
1504          "* prop" : "colModel[]",
1505          "dataIndex" : "itemsrc_active"
1506         }
1507        ]
1508       }
1509      ]
1510     },
1511     {
1512      "listeners" : {
1513       "|activate" : "function() {\n    _this.hpanel = this;\n    if (_this.hgrid) {\n        _this.hgrid.footer.onClick('first');\n    }\n}"
1514      },
1515      "fitToframe" : true,
1516      "background" : true,
1517      "region" : "center",
1518      "title" : "History",
1519      "xtype" : "GridPanel",
1520      "fitContainer" : true,
1521      "$ xns" : "Roo",
1522      "tableName" : "events",
1523      "items" : [
1524       {
1525        "listeners" : {
1526         "|render" : "function() \n{\n    _this.hgrid = this; \n    if (_this.hpanel.active) {\n       this.footer.onClick('first');\n    }\n}"
1527        },
1528        "autoExpandColumn" : "remarks",
1529        "xtype" : "Grid",
1530        "loadMask" : true,
1531        "$ xns" : "Roo.grid",
1532        "* prop" : "grid",
1533        "items" : [
1534         {
1535          "listeners" : {
1536           "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n    \n    options.params.on_table = 'item';\n    options.params.on_id = _this.form.findField('item_id').getValue();\n}"
1537          },
1538          "xtype" : "Store",
1539          "remoteSort" : true,
1540          "$ sortInfo" : "{ field : 'event_when', direction: 'DESC' }",
1541          "$ xns" : "Roo.data",
1542          "* prop" : "dataSource",
1543          "items" : [
1544           {
1545            "$ url" : "baseURL + '/Roo/events.php'",
1546            "method" : "GET",
1547            "xtype" : "HttpProxy",
1548            "$ xns" : "Roo.data",
1549            "* prop" : "proxy"
1550           },
1551           {
1552            "id" : "id",
1553            "root" : "data",
1554            "xtype" : "JsonReader",
1555            "$ fields" : "[\n    {\n        'name': 'event_when',\n        'type': 'date'\n    },\n    {\n        'name': 'action',\n        'type': 'string'\n    },\n    {\n        'name': 'ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    }\n]",
1556            "$ xns" : "Roo.data",
1557            "* prop" : "reader",
1558            "totalProperty" : "total"
1559           }
1560          ]
1561         },
1562         {
1563          "pageSize" : 25,
1564          "xtype" : "PagingToolbar",
1565          "emptyMsg" : "No Events found",
1566          "$ xns" : "Roo",
1567          "displayMsg" : "Displaying events{0} - {1} of {2}",
1568          "displayInfo" : true,
1569          "* prop" : "footer"
1570         },
1571         {
1572          "xtype" : "ColumnModel",
1573          "width" : 120,
1574          "header" : "Changed",
1575          "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
1576          "$ xns" : "Roo.grid",
1577          "* prop" : "colModel[]",
1578          "dataIndex" : "event_when"
1579         },
1580         {
1581          "xtype" : "ColumnModel",
1582          "width" : 200,
1583          "header" : "Action",
1584          "$ renderer" : "function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }",
1585          "$ xns" : "Roo.grid",
1586          "* prop" : "colModel[]",
1587          "dataIndex" : "action"
1588         },
1589         {
1590          "xtype" : "ColumnModel",
1591          "width" : 200,
1592          "header" : "IP Address",
1593          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1594          "$ xns" : "Roo.grid",
1595          "* prop" : "colModel[]",
1596          "dataIndex" : "ipaddr"
1597         },
1598         {
1599          "xtype" : "ColumnModel",
1600          "width" : 75,
1601          "header" : "Who",
1602          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1603          "$ xns" : "Roo.grid",
1604          "* prop" : "colModel[]",
1605          "dataIndex" : "person_id_name"
1606         },
1607         {
1608          "xtype" : "ColumnModel",
1609          "width" : 200,
1610          "header" : "Notes",
1611          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1612          "$ xns" : "Roo.grid",
1613          "* prop" : "colModel[]",
1614          "dataIndex" : "remarks"
1615         }
1616        ]
1617       }
1618      ]
1619     },
1620     {
1621      "listeners" : {
1622       "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
1623      },
1624      "text" : "Cancel",
1625      "xtype" : "Button",
1626      "$ xns" : "Roo",
1627      "* prop" : "buttons[]"
1628     },
1629     {
1630      "listeners" : {
1631       "render" : "function (_self)\n{\n    _this.saveBtn = this;\n}",
1632       "click" : "function (_self, e)\n{\n    // do some checks?\n     \n    \n  //  _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
1633      },
1634      "text" : "Save",
1635      "xtype" : "Button",
1636      "$ xns" : "Roo",
1637      "* prop" : "buttons[]"
1638     }
1639    ]
1640   }
1641  ]
1642 }