1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.CoreOAuthClient = new Roo.XComponent({
6 part : ["Core","OAuthClient"],
7 order : '900-Pman.Tab.CoreOAuthClient',
9 parent : 'Pman.Tab.Admin',
10 name : "unnamed module",
18 xtype: 'NestedLayoutPanel',
21 title : "Oauth2 Clients",
23 xtype: 'BorderLayout',
30 activate : function() {
34 _this.grid.footer.onClick('first');
42 tableName : 'core_oauth_clients',
43 title : "Oauth2 Clients",
51 if (_this.panel.active) {
52 this.footer.onClick('first');
55 afteredit : function (e)
57 if(e.originalValue == e.value || !e.value.length){
64 autoExpandColumn : 'redirect_uri',
71 beforeload : function (_self, o){
72 o.params = o.params || {};
75 update : function (_self, record, operation)
77 if (operation != Roo.data.Record.COMMIT) {
82 if (typeof(_this.data._hide_name) != 'undefined') {
83 record.set('name', record.data.display_name);
85 if (!record.data.client_id.length || !record.data.client_secret.length) {
91 url : baseURL + '/Roo/Core_enum.php',
95 etype : _this.data.etype,
96 name : record.data.name,
97 active : record.data.active,
98 seqid : record.data.seqid,
99 display_name : record.data.display_name
101 success : function(res) {
103 // update the ID if it's not set..
104 if (record.data.id * 1 < 1) {
105 record.set('id', res.data.id);
113 sortInfo : { field : 'client_id', direction: 'ASC' },
118 url : baseURL + '/Roo/Core_oauth_clients'
125 totalProperty : 'total',
132 'name': 'client_secret',
136 'name': 'redirect_uri',
152 var status = _this.form.findField('pohead_status').getValue();
155 Roo.MessageBox.alert("Error", "This PO has been closed");
159 var ct = _this.grid.ds.getCount();
161 var last = ct ? _this.grid.ds.getAt(ct-1).data.poitem_linenumber * 1 + 1 : 1;
163 var dt = _this.form.findField('pohead_orderdate').getValue();
165 var nr = _this.grid.ds.reader.newRow({
167 poitem_linenumber : last,
171 poitem_qty_ordered : 1,
175 _this.grid.stopEditing();
176 _this.grid.ds.insert(_this.grid.ds.getCount(), nr);
177 _this.grid.startEditing(_this.grid.ds.getCount()-1, 1);
180 cls : 'x-btn-text-icon',
182 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
190 var status = _this.form.findField('pohead_status').getValue();
193 Roo.MessageBox.alert("Error", "This PO has been closed");
197 var cs = _this.grid.getSelectionModel().getSelectedCell();
199 Roo.MessageBox.alert("Error", "Select a cell");
202 _this.grid.stopEditing();
203 var r = _this.grid.ds.getAt(cs[0]);
205 if(r.data.poitem_qty_received * 1 > 0){
206 Roo.MessageBox.alert("Error", "This item has been receipted");
211 _this.grid.ds.remove(r);
215 cls : 'x-btn-text-icon',
217 icon : rootURL + '/Pman/templates/images/trash.gif'
222 xtype: 'PagingToolbar',
225 emptyMsg : "No Clients found",
230 xtype: 'ColumnModel',
232 dataIndex : 'client_id',
233 header : 'Client ID',
235 renderer : function(v) {
236 return String.format('{0}', v ? v : '');
249 xtype: 'ColumnModel',
251 dataIndex : 'client_secret',
252 header : 'Client Secret',
254 renderer : function(v) {
255 return String.format('{0}', v ? v : '');
268 xtype: 'ColumnModel',
270 dataIndex : 'redirect_uri',
271 header : 'Redirect URI',
273 renderer : function(v) {
274 return String.format('{0}', v ? v : '');
290 xtype: 'LayoutRegion',