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 '7215ee9c7d9dc229d2921a40e899ec5f' :" "
31 part : ["Admin", "Enum" ],
32 order : '500-Pman.Tab.AdminEnum',
34 parent : 'Pman.Tab.Admin',
35 name : "Pman.Tab.AdminEnum",
44 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
47 xtype : 'NestedLayoutPanel',
51 xtype : 'BorderLayout',
55 xtype : 'LayoutRegion'
62 xtype : 'LayoutRegion'
68 tableName : 'core_enum',
69 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
74 activate : function() {
77 // _this.egrid.footer.onClick('first');
82 autoExpandColumn : 'display_name',
89 afteredit : function (e)
93 beforeedit : function (e)
95 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
99 cellclick : function (_self, rowIndex, columnIndex, e)
102 var di = this.colModel.getDataIndex(columnIndex);
103 if (di != 'active') {
107 var rec = _this.grid.ds.getAt(rowIndex);
109 rec.set('active', rec.data.active ? 0 : 1);
114 celldblclick : function (_self, rowIndex, columnIndex, e)
116 var rec = _this.egrid.ds.getAt(rowIndex);
117 Pman.Dialog.AdminEnumType.show(rec.data,function(){
119 _this.egrid.footer.onClick('first');
125 //_this.dialog = Pman.Dialog.FILL_IN
126 if (_this.epanel.active) {
127 this.footer.onClick('first');
133 displayMsg : _this._strings['7215ee9c7d9dc229d2921a40e899ec5f'] /* */,
134 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'] /* No core_enum found */,
138 xtype : 'PagingToolbar'
146 cls : 'x-btn-text-icon',
147 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
148 text : _this._strings['fdff10eac021dfbb69e9c38204237fdc'] /* Add new pulldown list */,
150 '|xns' : 'Roo.Toolbar',
162 Pman.Dialog.AdminEnumType.show(data,function(){
164 _this.egrid.footer.onClick('first');
176 sortInfo : { field : 'display_name', direction: 'ASC' },
181 beforeload : function (_self, o)
183 o.params['query[empty_etype]'] = 1;
186 update : function (_self, record, operation)
188 if (operation != Roo.data.Record.COMMIT) {
193 url : baseURL + '/Roo/Core_enum.php',
197 etype : _this.grid.ds.getById(record.id).data.etype,
198 name : record.data.name,
199 active : record.data.active,
200 seqid : record.data.seqid,
201 display_name : record.data.display_name
203 success : function(res) {
205 // update the ID if it's not set..
206 if (record.data.id * 1 < 1) {
207 record.set('id', res.data.id);
216 url : baseURL + '/Roo/core_enum.php',
246 totalProperty : 'total',
255 xtype : 'CellSelectionModel',
257 selectionchange : function (_self, selection)
259 _this.grid.footer.onClick('first');
265 dataIndex : 'display_name',
266 header : _this._strings['1206eb8aea05be4625371c9c12818785'] /* Pulldown */,
267 renderer : function(v,x,r) {
270 return String.format('<span qtip="{1}">{0}</span>', (''+v).length ? v : r.data.name, r.data.name);
275 xtype : 'ColumnModel'
278 dataIndex : 'active',
279 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
280 renderer : function(v) {
281 var state = v> 0 ? '-checked' : '';
283 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
289 xtype : 'ColumnModel'
298 tableName : 'core_enum',
299 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
304 activate : function() {
307 _this.grid.footer.onClick('first');
312 autoExpandColumn : 'display_name',
317 xtype : 'EditorGrid',
319 afteredit : function (e)
323 beforeedit : function (e)
325 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
329 cellclick : function (_self, rowIndex, columnIndex, e)
332 var di = this.colModel.getDataIndex(columnIndex);
333 var rec = _this.grid.ds.getAt(rowIndex);
335 if (di == 'active') {
337 rec.set('active', rec.data.active ? 0 : 1);
343 if (!e.ctrlKey && !e.shiftKey) { // shift or control not pressed -clear selection.
345 this.dataSource.each(function(rr) {
351 if (this.last_selected && e.shiftKey) {
352 // the highlight all the lines between the one last selected, and this one.
353 var s = this.dataSource.indexOf(this.last_selected);
354 var e = this.dataSource.indexOf(rec);
355 var ss = Math.min(s,e);
356 var ee = Math.max(s,e) +1;
357 for(var i = ss; i < ee; i++) {
358 var rr = this.dataSource.getAt(i);
362 this.last_selected = rec;
367 rec.selected = rec.selected ? 0 : 1;
368 this.last_selected = rec.selected ? rec : false;
369 rec.set('sel', rec.data.sel ? 0 : 1);
376 keypress : function (e)
379 _this.grid.footer.onClick('first');
385 //_this.dialog = Pman.Dialog.FILL_IN
386 if (_this.panel.active) {
387 this.footer.onClick('first');
393 displayMsg : _this._strings['510bc6e58593b2b8002c9fe0c21f3fde'] /* Displaying core_enum{0} - {1} of {2} */,
394 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'] /* No core_enum found */,
398 xtype : 'PagingToolbar',
401 text : _this._strings['801ab24683a4a8c433c6eb40c48bcd9d'] /* Download */,
403 '|xns' : 'Roo.Toolbar',
406 click : function (_self, e)
411 Roo.MessageBox.alert("Downloading", "File is downloading");
416 text : _this._strings['c550aeed26e71a81a88360c1889245ab'] /* Upload Values */,
418 '|xns' : 'Roo.Toolbar',
421 click : function (_self, e)
424 var s = _this.egrid.getSelectionModel().getSelectedCell();
428 Roo.MessageBox.alert("Error", "Select a pulldown");
431 var d = _this.egrid.dataSource.getAt(s[0]);
434 var etype = d.data.name;
437 Roo.MessageBox.alert('Error', 'Please select a pulldown');
441 Pman.Dialog.Image.show(
443 _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})
447 _this.grid.footer.onClick('first');
461 cls : 'x-btn-text-icon',
462 icon : rootURL + '/Pman/templates/images/search.gif',
463 text : _this._strings['d9ec74f5aa29ceef6bf7b45f7fec5d0f'] /* Add Value */,
465 '|xns' : 'Roo.Toolbar',
471 // if we do not have a selected type... - what should we show..?
474 var s = _this.egrid.getSelectionModel().getSelectedCell();
478 Roo.MessageBox.alert("Error", "Select a pulldown");
481 var d = _this.egrid.dataSource.getAt(s[0]);
484 var ds = _this.grid.getDataSource();
486 var add = ds.reader.newRow({
497 _this.grid.startEditing(0, _this.grid.colModel.findColumnIndex('name')); // name...
502 cls : 'x-btn-text-icon',
503 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
504 text : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
506 '|xns' : 'Roo.Toolbar',
512 // if we do not have a selected type... - what should we show..?
513 var et = _this.etypeCombo.getValue();
516 Roo.MessageBox.alert("Error", "Select a pulldown");
519 var sc = _this.grid.getSelectionModel().getSelectedCell();
521 var ds = _this.grid.ds.getAt(sc[0]);
523 Roo.MessageBox.alert("Error", "Select enum");
528 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
529 _this.grid.footer.onClick('first');
536 fieldLabel : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'] /* Search */,
542 render : function (_self)
544 _this.searchBox = this;
550 icon : rootURL + '/Pman/templates/images/search.gif',
552 '|xns' : 'Roo.Toolbar',
555 click : function (_self, e)
557 _this.grid.footer.onClick('first');
563 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
565 '|xns' : 'Roo.Toolbar',
568 click : function (_self, e)
570 _this.searchBox.setValue('');
571 _this.grid.footer.onClick('first');
577 '|xns' : 'Roo.Toolbar',
581 cls : 'x-btn-text-icon',
582 icon : rootURL + '/Pman/templates/images/trash.gif',
583 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
585 '|xns' : 'Roo.Toolbar',
591 _this.grid.dataSource.each(function(rr) {
593 ids.push(rr.data.id);
597 Roo.MessageBox.alert("Error", "Select rows by clicking on the Internal# column");
601 Roo.MessageBox.confirm(
603 "Confirm Deletion of selected rows (some rows can not be deleted if they are referenced elsewhere",
610 url : baseURL + '/Roo/Core_enum',
612 _delete : ids.join(',')
614 success : function() {
615 _this.grid.footer.onClick('refresh');
627 '|xns' : 'Roo.Toolbar',
631 cls : 'x-btn-text-icon',
632 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
633 text : _this._strings['1a87a3d29199e3435b8fb314624c008f'] /* Merge Option */,
635 '|xns' : 'Roo.Toolbar',
640 var s = _this.grid.getSelectionModel().getSelectedCell();
643 Roo.MessageBox.alert("Error", "Select a Row");
647 var d = _this.grid.ds.getAt(s[0]);
649 Pman.Dialog.AdminEnumMerge.show(d.data, function() {
650 _this.grid.footer.onClick('refresh');
660 sortInfo : { field : 'etype', direction: 'ASC' },
665 beforeload : function (_self, options)
668 var s = _this.egrid.getSelectionModel().getSelectedCell();
674 var d = _this.egrid.dataSource.getAt(s[0]);
676 options.params.etype = d.data.name;
677 options.params['query[search]'] = _this.searchBox.getValue();
678 if (!options.params.etype.length) {
682 update : function (_self, record, operation)
684 if (operation != Roo.data.Record.COMMIT) {
689 url : baseURL + '/Roo/Core_enum.php',
693 etype : _this.grid.ds.getById(record.id).data.etype,
694 name : record.data.name,
695 active : record.data.active,
696 seqid : record.data.seqid,
697 display_name : record.data.display_name
699 success : function(res) {
701 // update the ID if it's not set..
702 if (record.data.id * 1 < 1) {
703 record.set('id', res.data.id);
712 url : baseURL + '/Roo/core_enum.php',
742 totalProperty : 'total',
751 header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'] /* Internal # */,
752 renderer : function(v,x,r) {
755 fmt = '<span style="color:orange;font-weight:bold;">{0}</span>';
757 return String.format(fmt, v); },
762 xtype : 'ColumnModel'
765 dataIndex : 'images_id_id',
766 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
767 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); },
771 xtype : 'ColumnModel'
775 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
776 renderer : function(v) { return String.format('{0}', v); },
781 xtype : 'ColumnModel',
785 xtype : 'GridEditor',
794 dataIndex : 'display_name',
795 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
796 renderer : function(v) { return String.format('{0}', v); },
801 xtype : 'ColumnModel',
805 xtype : 'GridEditor',
814 dataIndex : 'active',
815 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
816 renderer : function(v) {
817 var state = v> 0 ? '-checked' : '';
819 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
826 xtype : 'ColumnModel'
830 header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'] /* Order # */,
831 renderer : function(v) { return String.format('{0}', v); },
836 xtype : 'ColumnModel',
840 xtype : 'GridEditor',
842 allowDecimals : false,
843 allowNegative : true,
844 decimalPrecision : 0,
847 xtype : 'NumberField'