php7 fixes
[Pman.Builder] / Pman.Dialog.BuilderImport.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.BuilderImport = {
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 : 330,
36             modal : true,
37             resizable : false,
38             title : "Edit / Create core_enum",
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                                        
54                                        this.load({ method: 'GET', params: { '_id' : _this.data.id }});
55                                        return;
56                                     }
57                                     if (action.type == 'load') {
58                                  
59                                         return;
60                                     }
61                                     if (action.type =='submit') {
62                                      
63                                         _this.dialog.hide();
64                                     
65                                          if (_this.callback) {
66                                             _this.callback.call(_this, _this.form.getValues());
67                                          }
68                                          _this.form.reset();
69                                          return;
70                                     }
71                                 },
72                                 rendered : function (form)
73                                 {
74                                     _this.form= form;
75                                 }
76                             },
77                             labelAlign : 'top',
78                             method : 'POST',
79                             style : 'margin:10px;',
80                             url : baseURL + '/Roo/builder_part',
81                             items : [
82                                 {
83                                     xtype: 'TextArea',
84                                     xns: Roo.form,
85                                     fieldLabel : 'Paste BJS code from export',
86                                     height : 200,
87                                     name : 'json',
88                                     width : 410
89                                 },
90                                 {
91                                     xtype: 'Hidden',
92                                     xns: Roo.form,
93                                     name : 'id'
94                                 }
95                             ]
96                         }
97                     ]
98                 }
99             ],
100             center : {
101                 xtype: 'LayoutRegion',
102                 xns: Roo
103             },
104             buttons : [
105                 {
106                     xtype: 'Button',
107                     xns: Roo,
108                     listeners : {
109                         click : function (_self, e)
110                         {
111                             _this.dialog.hide();
112                         }
113                     },
114                     text : "Cancel"
115                 },
116                 {
117                     xtype: 'Button',
118                     xns: Roo,
119                     listeners : {
120                         click : function (_self, e)
121                         {
122                             // do some checks?
123                              
124                             
125                             _this.dialog.el.mask("Saving");
126                             _this.form.doAction("submit");
127                         
128                         }
129                     },
130                     text : "Save"
131                 }
132             ]
133         });
134     }
135 };