1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.AdminEnum = new Roo.XComponent({
10 '2df80d5febcde0c10a66818488622b7c' :"Pulldown Options",
11 '13348442cc6a27032d2b4aa28b75a5d3' :"Search",
12 'd1228f5476d15142b1358ae4b5fa2454' :"Order #",
13 'fdff10eac021dfbb69e9c38204237fdc' :"Add new pulldown list",
14 '1206eb8aea05be4625371c9c12818785' :"Pulldown",
15 '801ab24683a4a8c433c6eb40c48bcd9d' :"Download",
16 '7af54708cf5a4286cf0cfa58ff5148a8' :"Internal #",
17 'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
18 '1a87a3d29199e3435b8fb314624c008f' :"Merge Option",
19 'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
20 '510bc6e58593b2b8002c9fe0c21f3fde' :"Displaying core_enum{0} - {1} of {2}",
21 '1ba4d808fc7b27a7f60ce2ff75a8af3a' :"No core_enum found",
22 'c550aeed26e71a81a88360c1889245ab' :"Upload Values",
23 'd9ec74f5aa29ceef6bf7b45f7fec5d0f' :"Add Value",
24 'b9c49611cfda3259a2b837b39489e650' :"Add Image",
25 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
26 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
27 '49ee3087348e8d44e1feda1917443987' :"Name",
28 'd41d8cd98f00b204e9800998ecf8427e' :" "
31 part : ["Admin", "Enum" ],
32 order : '500-Pman.Tab.AdminEnum',
34 parent : 'Pman.Tab.Admin',
35 name : "Pman.Tab.AdminEnum",
38 _tree : function(_data)
43 xtype : 'NestedLayoutPanel',
45 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
49 xtype : 'BorderLayout',
53 xtype : 'LayoutRegion',
58 xtype : 'LayoutRegion',
69 tableName : 'core_enum',
70 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
72 activate : function() {
75 // _this.egrid.footer.onClick('first');
83 autoExpandColumn : 'display_name',
87 afteredit : function (e)
91 beforeedit : function (e)
93 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
97 cellclick : function (_self, rowIndex, columnIndex, e)
100 var di = this.colModel.getDataIndex(columnIndex);
101 if (di != 'active') {
105 var rec = _this.grid.ds.getAt(rowIndex);
107 rec.set('active', rec.data.active ? 0 : 1);
112 celldblclick : function (_self, rowIndex, columnIndex, e)
114 var rec = _this.egrid.ds.getAt(rowIndex);
115 Pman.Dialog.AdminEnumType.show(rec.data,function(){
117 _this.egrid.footer.onClick('first');
123 //_this.dialog = Pman.Dialog.FILL_IN
124 if (_this.epanel.active) {
125 this.footer.onClick('first');
132 xtype : 'PagingToolbar',
134 displayMsg : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
135 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'] /* No core_enum found */,
147 cls : 'x-btn-text-icon',
148 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
149 text : _this._strings['fdff10eac021dfbb69e9c38204237fdc'] /* Add new pulldown list */,
160 Pman.Dialog.AdminEnumType.show(data,function(){
162 _this.egrid.footer.onClick('first');
170 '|xns' : 'Roo.Toolbar'
177 sortInfo : { field : 'display_name', direction: 'ASC' },
179 beforeload : function (_self, o)
181 o.params['query[empty_etype]'] = 1;
184 update : function (_self, record, operation)
186 if (operation != Roo.data.Record.COMMIT) {
191 url : baseURL + '/Roo/Core_enum.php',
195 etype : _this.grid.ds.getById(record.id).data.etype,
196 name : record.data.name,
197 active : record.data.active,
198 seqid : record.data.seqid,
199 display_name : record.data.display_name
201 success : function(res) {
203 // update the ID if it's not set..
204 if (record.data.id * 1 < 1) {
205 record.set('id', res.data.id);
217 url : baseURL + '/Roo/core_enum.php',
222 xtype : 'JsonReader',
247 totalProperty : 'total',
253 xtype : 'CellSelectionModel',
255 selectionchange : function (_self, selection)
257 _this.grid.footer.onClick('first');
265 xtype : 'ColumnModel',
266 dataIndex : 'display_name',
267 header : _this._strings['1206eb8aea05be4625371c9c12818785'] /* Pulldown */,
268 renderer : function(v,x,r) {
271 return String.format('<span qtip="{1}">{0}</span>', (''+v).length ? v : r.data.name, r.data.name);
278 xtype : 'ColumnModel',
279 dataIndex : 'active',
280 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
281 renderer : function(v) {
282 var state = v> 0 ? '-checked' : '';
284 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
299 tableName : 'core_enum',
300 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
302 activate : function() {
305 _this.grid.footer.onClick('first');
312 xtype : 'EditorGrid',
313 autoExpandColumn : 'display_name',
317 afteredit : function (e)
321 beforeedit : function (e)
323 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
327 cellclick : function (_self, rowIndex, columnIndex, e)
330 var di = this.colModel.getDataIndex(columnIndex);
331 var rec = _this.grid.ds.getAt(rowIndex);
333 if (di == 'active') {
335 rec.set('active', rec.data.active ? 0 : 1);
341 if (!e.ctrlKey && !e.shiftKey) { // shift or control not pressed -clear selection.
343 this.dataSource.each(function(rr) {
349 if (this.last_selected && e.shiftKey) {
350 // the highlight all the lines between the one last selected, and this one.
351 var s = this.dataSource.indexOf(this.last_selected);
352 var e = this.dataSource.indexOf(rec);
353 var ss = Math.min(s,e);
354 var ee = Math.max(s,e) +1;
355 for(var i = ss; i < ee; i++) {
356 var rr = this.dataSource.getAt(i);
360 this.last_selected = rec;
365 rec.selected = rec.selected ? 0 : 1;
366 this.last_selected = rec.selected ? rec : false;
367 rec.set('sel', rec.data.sel ? 0 : 1);
374 keypress : function (e)
377 _this.grid.footer.onClick('first');
383 //_this.dialog = Pman.Dialog.FILL_IN
384 if (_this.panel.active) {
385 this.footer.onClick('first');
392 xtype : 'PagingToolbar',
394 displayMsg : _this._strings['510bc6e58593b2b8002c9fe0c21f3fde'] /* Displaying core_enum{0} - {1} of {2} */,
395 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'] /* No core_enum found */,
402 text : _this._strings['801ab24683a4a8c433c6eb40c48bcd9d'] /* Download */,
404 click : function (_self, e)
409 Roo.MessageBox.alert("Downloading", "File is downloading");
413 '|xns' : 'Roo.Toolbar'
417 text : _this._strings['c550aeed26e71a81a88360c1889245ab'] /* Upload Values */,
419 click : function (_self, e)
422 var s = _this.egrid.getSelectionModel().getSelectedCell();
426 Roo.MessageBox.alert("Error", "Select a pulldown");
429 var d = _this.egrid.dataSource.getAt(s[0]);
432 var etype = d.data.name;
435 Roo.MessageBox.alert('Error', 'Please select a pulldown');
439 Pman.Dialog.Image.show(
441 _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})
445 _this.grid.footer.onClick('first');
451 '|xns' : 'Roo.Toolbar'
462 cls : 'x-btn-text-icon',
463 icon : rootURL + '/Pman/templates/images/search.gif',
464 text : _this._strings['d9ec74f5aa29ceef6bf7b45f7fec5d0f'] /* Add Value */,
469 // if we do not have a selected type... - what should we show..?
472 var s = _this.egrid.getSelectionModel().getSelectedCell();
476 Roo.MessageBox.alert("Error", "Select a pulldown");
479 var d = _this.egrid.dataSource.getAt(s[0]);
482 var ds = _this.grid.getDataSource();
484 var add = ds.reader.newRow({
495 _this.grid.startEditing(0, _this.grid.colModel.findColumnIndex('name')); // name...
499 '|xns' : 'Roo.Toolbar'
503 cls : 'x-btn-text-icon',
504 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
505 text : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
510 // if we do not have a selected type... - what should we show..?
511 var et = _this.etypeCombo.getValue();
514 Roo.MessageBox.alert("Error", "Select a pulldown");
517 var sc = _this.grid.getSelectionModel().getSelectedCell();
519 var ds = _this.grid.ds.getAt(sc[0]);
521 Roo.MessageBox.alert("Error", "Select enum");
526 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
527 _this.grid.footer.onClick('first');
533 '|xns' : 'Roo.Toolbar'
537 fieldLabel : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'] /* Search */,
540 render : function (_self)
542 _this.searchBox = this;
551 icon : rootURL + '/Pman/templates/images/search.gif',
553 click : function (_self, e)
555 _this.grid.footer.onClick('first');
559 '|xns' : 'Roo.Toolbar'
564 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
566 click : function (_self, e)
568 _this.searchBox.setValue('');
569 _this.grid.footer.onClick('first');
573 '|xns' : 'Roo.Toolbar'
578 '|xns' : 'Roo.Toolbar'
582 cls : 'x-btn-text-icon',
583 icon : rootURL + '/Pman/templates/images/trash.gif',
584 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
589 _this.grid.dataSource.each(function(rr) {
591 ids.push(rr.data.id);
595 Roo.MessageBox.alert("Error", "Select rows by clicking on the Internal# column");
599 Roo.MessageBox.confirm(
601 "Confirm Deletion of selected rows (some rows can not be deleted if they are referenced elsewhere",
608 url : baseURL + '/Roo/Core_enum',
610 _delete : ids.join(',')
612 success : function() {
613 _this.grid.footer.onClick('refresh');
623 '|xns' : 'Roo.Toolbar'
628 '|xns' : 'Roo.Toolbar'
632 cls : 'x-btn-text-icon',
633 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
634 text : _this._strings['1a87a3d29199e3435b8fb314624c008f'] /* Merge Option */,
638 var s = _this.grid.getSelectionModel().getSelectedCell();
641 Roo.MessageBox.alert("Error", "Select a Row");
645 var d = _this.grid.ds.getAt(s[0]);
647 Pman.Dialog.AdminEnumMerge.show(d.data, function() {
648 _this.grid.footer.onClick('refresh');
654 '|xns' : 'Roo.Toolbar'
661 sortInfo : { field : 'etype', direction: 'ASC' },
663 beforeload : function (_self, options)
666 var s = _this.egrid.getSelectionModel().getSelectedCell();
672 var d = _this.egrid.dataSource.getAt(s[0]);
674 options.params.etype = d.data.name;
675 options.params['query[search]'] = _this.searchBox.getValue();
676 if (!options.params.etype.length) {
680 update : function (_self, record, operation)
682 if (operation != Roo.data.Record.COMMIT) {
687 url : baseURL + '/Roo/Core_enum.php',
691 etype : _this.grid.ds.getById(record.id).data.etype,
692 name : record.data.name,
693 active : record.data.active,
694 seqid : record.data.seqid,
695 display_name : record.data.display_name
697 success : function(res) {
699 // update the ID if it's not set..
700 if (record.data.id * 1 < 1) {
701 record.set('id', res.data.id);
713 url : baseURL + '/Roo/core_enum.php',
718 xtype : 'JsonReader',
743 totalProperty : 'total',
750 xtype : 'ColumnModel',
752 header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'] /* Internal # */,
753 renderer : function(v,x,r) {
756 fmt = '<span style="color:orange;font-weight:bold;">{0}</span>';
758 return String.format(fmt, v); },
765 xtype : 'ColumnModel',
766 dataIndex : 'images_id_id',
767 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
768 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/25/{1}/{2}" width="25" height="25">', baseURL, v, r.data.images_id_filename); },
774 xtype : 'ColumnModel',
776 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
777 renderer : function(v) { return String.format('{0}', v); },
783 xtype : 'GridEditor',
794 xtype : 'ColumnModel',
795 dataIndex : 'display_name',
796 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
797 renderer : function(v) { return String.format('{0}', v); },
803 xtype : 'GridEditor',
814 xtype : 'ColumnModel',
815 dataIndex : 'active',
816 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
817 renderer : function(v) {
818 var state = v> 0 ? '-checked' : '';
820 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
829 xtype : 'ColumnModel',
831 header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'] /* Order # */,
832 renderer : function(v) { return String.format('{0}', v); },
838 xtype : 'GridEditor',
842 xtype : 'NumberField',
843 allowDecimals : false,
844 allowNegative : true,
845 decimalPrecision : 0,