php warnings
[Pman.MTrack] / Pman.Dialog.MTrackRepos.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.MTrackRepos = {
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 : 420,
36             modal : true,
37             resizable : false,
38             title : "Edit / Create mtrack_repos",
39             width : 400,
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.id) {
54                                            this.load({ method: 'GET', params: { '_id' : _this.data.id }});
55                                        }
56                                        return;
57                                     }
58                                     if (action.type == 'load') {
59                                  
60                                         return;
61                                     }
62                                     if (action.type =='submit') {
63                                     
64                                  
65                                         _this.dialog.hide();
66                                     
67                                          if (_this.callback) {
68                                             _this.callback.call(_this, _this.form.getValues());
69                                          }
70                                          _this.form.reset();
71                                          return;
72                                     }
73                                 },
74                                 rendered : function (form)
75                                 {
76                                     _this.form= form;
77                                 }
78                             },
79                             method : 'POST',
80                             style : 'margin:10px;',
81                             url : baseURL + '/Roo/mtrack_repos.php',
82                             items : [
83                                 {
84                                     xtype: 'ComboBox',
85                                     xns: Roo.form,
86                                     allowBlank : false,
87                                     alwaysQuery : true,
88                                     displayField : 'name',
89                                     editable : false,
90                                     emptyText : "Select Project",
91                                     fieldLabel : 'Project',
92                                     forceSelection : false,
93                                     hiddenName : 'project_id',
94                                     listWidth : 400,
95                                     loadingText : "Searching...",
96                                     minChars : 2,
97                                     name : 'project_id_name',
98                                     pageSize : 20,
99                                     qtip : "Select Projects",
100                                     queryParam : 'query[name]',
101                                     selectOnFocus : true,
102                                     tpl : '<div class="x-grid-cell-text x-btn button"><b>{code}</b> {name} </div>',
103                                     triggerAction : 'all',
104                                     typeAhead : true,
105                                     valueField : 'id',
106                                     width : 200,
107                                     store : {
108                                         xtype: 'Store',
109                                         xns: Roo.data,
110                                         listeners : {
111                                             beforeload : function (_self, o){
112                                                 o.params = o.params || {};
113                                                 // set more here
114                                             }
115                                         },
116                                         remoteSort : true,
117                                         sortInfo : { direction : 'ASC', field: 'code' },
118                                         proxy : {
119                                             xtype: 'HttpProxy',
120                                             xns: Roo.data,
121                                             method : 'GET',
122                                             url : baseURL + '/Roo/core_project'
123                                         },
124                                         reader : {
125                                             xtype: 'JsonReader',
126                                             xns: Roo.data,
127                                             id : 'id',
128                                             root : 'data',
129                                             totalProperty : 'total',
130                                             fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
131                                         }
132                                     }
133                                 },
134                                 {
135                                     xtype: 'TextField',
136                                     xns: Roo.form,
137                                     fieldLabel : 'Shortname',
138                                     name : 'shortname',
139                                     width : 200
140                                 },
141                                 {
142                                     xtype: 'TextField',
143                                     xns: Roo.form,
144                                     fieldLabel : 'Scmtype',
145                                     name : 'scmtype',
146                                     width : 200
147                                 },
148                                 {
149                                     xtype: 'TextField',
150                                     xns: Roo.form,
151                                     fieldLabel : 'Repopath',
152                                     name : 'repopath',
153                                     width : 200
154                                 },
155                                 {
156                                     xtype: 'TextField',
157                                     xns: Roo.form,
158                                     fieldLabel : 'Browserurl',
159                                     name : 'browserurl',
160                                     width : 200
161                                 },
162                                 {
163                                     xtype: 'TextField',
164                                     xns: Roo.form,
165                                     fieldLabel : 'Browsertype',
166                                     name : 'browsertype',
167                                     width : 200
168                                 },
169                                 {
170                                     xtype: 'TextArea',
171                                     xns: Roo.form,
172                                     fieldLabel : 'Description',
173                                     name : 'description',
174                                     width : 200,
175                                     height : 100
176                                 },
177                                 {
178                                     xtype: 'TextField',
179                                     xns: Roo.form,
180                                     fieldLabel : 'Serverurl',
181                                     name : 'serverurl',
182                                     width : 200
183                                 },
184                                 {
185                                     xtype: 'Hidden',
186                                     xns: Roo.form,
187                                     name : 'id'
188                                 }
189                             ]
190                         }
191                     ]
192                 }
193             ],
194             center : {
195                 xtype: 'LayoutRegion',
196                 xns: Roo
197             },
198             buttons : [
199                 {
200                     xtype: 'Button',
201                     xns: Roo,
202                     listeners : {
203                         click : function (_self, e)
204                         {
205                             _this.dialog.hide();
206                         }
207                     },
208                     text : "Cancel"
209                 },
210                 {
211                     xtype: 'Button',
212                     xns: Roo,
213                     listeners : {
214                         click : function (_self, e)
215                         {
216                             // do some checks?
217                              
218                             
219                          
220                             _this.form.doAction("submit");
221                         
222                         }
223                     },
224                     text : "Save"
225                 }
226             ]
227         });
228     }
229 };