Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleCurrency.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Dialog.XtupleCurrency = {
6
7     dialog : false,
8     callback:  false,
9
10     show : function(data, cb)
11     {
12         if (!this.dialog) {
13             this.create();
14         }
15
16         this.callback = cb;
17         this.data = data;
18         this.dialog.show(this.data._el);
19         if (this.form) {
20            this.form.reset();
21            this.form.setValues(data);
22            this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
23         }
24
25     },
26
27     create : function()
28     {
29         var _this = this;
30         this.dialog = Roo.factory({
31             xtype: 'LayoutDialog',
32             xns: Roo,
33             closable : false,
34             collapsible : false,
35             height : 200,
36             modal : true,
37             resizable : false,
38             title : "Edit / Create Currency",
39             width : 500,
40             items : [
41                 {
42                     xtype: 'ContentPanel',
43                     xns: Roo,
44                     region : 'center',
45                     items : [
46                         {
47                             xtype: 'Form',
48                             xns: Roo.form,
49                             listeners : {
50                                 actioncomplete : function(_self,action)
51                                 {
52                                     if (action.type == 'setdata') {
53                                         if(_this.data.curr_id){
54                                             _this.dialog.el.mask("Loading");
55                                             this.load({ method: 'GET', params: { '_id' : _this.data.curr_id }});
56                                             return;
57                                         }
58                                         return;
59                                     }
60                                     if (action.type == 'load') {
61                                         _this.dialog.el.unmask();
62                                         return;
63                                     }
64                                     if (action.type =='submit') {
65                                     
66                                         _this.dialog.el.unmask();
67                                         _this.dialog.hide();
68                                     
69                                          if (_this.callback) {
70                                             _this.callback.call(_this, _this.form.getValues());
71                                          }
72                                          _this.form.reset();
73                                          return;
74                                     }
75                                 },
76                                 rendered : function (form)
77                                 {
78                                     _this.form= form;
79                                 }
80                             },
81                             method : 'POST',
82                             style : 'margin:10px;',
83                             url : baseURL + '/Roo/Curr_symbol.php',
84                             items : [
85                                 {
86                                     xtype: 'TextField',
87                                     xns: Roo.form,
88                                     allowBlank : false,
89                                     fieldLabel : 'Name',
90                                     name : 'curr_name',
91                                     width : 200
92                                 },
93                                 {
94                                     xtype: 'TextField',
95                                     xns: Roo.form,
96                                     allowBlank : false,
97                                     fieldLabel : 'Symbol',
98                                     name : 'curr_symbol',
99                                     width : 200
100                                 },
101                                 {
102                                     xtype: 'TextField',
103                                     xns: Roo.form,
104                                     allowBlank : false,
105                                     fieldLabel : 'Abbr.',
106                                     name : 'curr_abbr',
107                                     width : 200
108                                 },
109                                 {
110                                     xtype: 'Checkbox',
111                                     xns: Roo.form,
112                                     boxLabel : 'Yes / No',
113                                     fieldLabel : 'Base',
114                                     inputValue : 'true',
115                                     name : 'curr_base',
116                                     valueOff : 0
117                                 },
118                                 {
119                                     xtype: 'Hidden',
120                                     xns: Roo.form,
121                                     name : 'curr_id'
122                                 }
123                             ]
124                         }
125                     ]
126                 }
127             ],
128             center : {
129                 xtype: 'LayoutRegion',
130                 xns: Roo
131             },
132             buttons : [
133                 {
134                     xtype: 'Button',
135                     xns: Roo,
136                     listeners : {
137                         click : function (_self, e)
138                         {
139                             _this.dialog.hide();
140                         }
141                     },
142                     text : "Cancel"
143                 },
144                 {
145                     xtype: 'Button',
146                     xns: Roo,
147                     listeners : {
148                         click : function (_self, e)
149                         {
150                             _this.form.doAction("submit");
151                         
152                         }
153                     },
154                     text : "Save"
155                 }
156             ]
157         });
158     }
159 };