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 'search_fieldLabel' : '13348442cc6a27032d2b4aa28b75a5d3' /* Search */
34 part : ["Admin", "Enum" ],
35 order : '500-Pman.Tab.AdminEnum',
37 parent : 'Pman.Tab.Admin',
38 name : "Pman.Tab.AdminEnum",
41 _tree : function(_data)
46 xtype : 'NestedLayoutPanel',
48 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
52 xtype : 'BorderLayout',
56 xtype : 'LayoutRegion',
61 xtype : 'LayoutRegion',
72 tableName : 'core_enum',
73 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
75 activate : function() {
78 // _this.egrid.footer.onClick('first');
86 autoExpandColumn : 'display_name',
90 afteredit : function (e)
94 beforeedit : function (e)
96 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
100 cellclick : function (_self, rowIndex, columnIndex, e)
103 var di = this.colModel.getDataIndex(columnIndex);
104 if (di != 'active') {
108 var rec = _this.grid.ds.getAt(rowIndex);
110 rec.set('active', rec.data.active ? 0 : 1);
115 celldblclick : function (_self, rowIndex, columnIndex, e)
117 var rec = _this.egrid.ds.getAt(rowIndex);
118 Pman.Dialog.AdminEnumType.show(rec.data,function(){
120 _this.egrid.footer.onClick('first');
126 //_this.dialog = Pman.Dialog.FILL_IN
127 if (_this.epanel.active) {
128 this.footer.onClick('first');
135 xtype : 'PagingToolbar',
137 displayMsg : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
138 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'] /* No core_enum found */,
150 cls : 'x-btn-text-icon',
151 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
152 text : _this._strings['fdff10eac021dfbb69e9c38204237fdc'] /* Add new pulldown list */,
163 Pman.Dialog.AdminEnumType.show(data,function(){
165 _this.egrid.footer.onClick('first');
173 '|xns' : 'Roo.Toolbar'
180 sortInfo : { field : 'display_name', direction: 'ASC' },
182 beforeload : function (_self, o)
184 o.params['query[empty_etype]'] = 1;
187 update : function (_self, record, operation)
189 if (operation != Roo.data.Record.COMMIT) {
194 url : baseURL + '/Roo/Core_enum.php',
198 etype : _this.grid.ds.getById(record.id).data.etype,
199 name : record.data.name,
200 active : record.data.active,
201 seqid : record.data.seqid,
202 display_name : record.data.display_name
204 success : function(res) {
206 // update the ID if it's not set..
207 if (record.data.id * 1 < 1) {
208 record.set('id', res.data.id);
220 url : baseURL + '/Roo/core_enum.php',
225 xtype : 'JsonReader',
250 totalProperty : 'total',
256 xtype : 'CellSelectionModel',
258 selectionchange : function (_self, selection)
260 _this.grid.footer.onClick('first');
268 xtype : 'ColumnModel',
269 dataIndex : 'display_name',
270 header : _this._strings['1206eb8aea05be4625371c9c12818785'] /* Pulldown */,
271 renderer : function(v,x,r) {
274 return String.format('<span qtip="{1}">{0}</span>', (''+v).length ? v : r.data.name, r.data.name);
281 xtype : 'ColumnModel',
282 dataIndex : 'active',
283 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
284 renderer : function(v) {
285 var state = v> 0 ? '-checked' : '';
287 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
302 tableName : 'core_enum',
303 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
305 activate : function() {
308 _this.grid.footer.onClick('first');
315 xtype : 'EditorGrid',
316 autoExpandColumn : 'display_name',
320 afteredit : function (e)
324 beforeedit : function (e)
326 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
330 cellclick : function (_self, rowIndex, columnIndex, e)
333 var di = this.colModel.getDataIndex(columnIndex);
334 var rec = _this.grid.ds.getAt(rowIndex);
336 if (di == 'active') {
338 rec.set('active', rec.data.active ? 0 : 1);
344 if (!e.ctrlKey && !e.shiftKey) { // shift or control not pressed -clear selection.
346 this.dataSource.each(function(rr) {
352 if (this.last_selected && e.shiftKey) {
353 // the highlight all the lines between the one last selected, and this one.
354 var s = this.dataSource.indexOf(this.last_selected);
355 var e = this.dataSource.indexOf(rec);
356 var ss = Math.min(s,e);
357 var ee = Math.max(s,e) +1;
358 for(var i = ss; i < ee; i++) {
359 var rr = this.dataSource.getAt(i);
363 this.last_selected = rec;
368 rec.selected = rec.selected ? 0 : 1;
369 this.last_selected = rec.selected ? rec : false;
370 rec.set('sel', rec.data.sel ? 0 : 1);
377 keypress : function (e)
380 _this.grid.footer.onClick('first');
386 //_this.dialog = Pman.Dialog.FILL_IN
387 if (_this.panel.active) {
388 this.footer.onClick('first');
395 xtype : 'PagingToolbar',
397 displayMsg : _this._strings['510bc6e58593b2b8002c9fe0c21f3fde'] /* Displaying core_enum{0} - {1} of {2} */,
398 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'] /* No core_enum found */,
405 text : _this._strings['801ab24683a4a8c433c6eb40c48bcd9d'] /* Download */,
407 click : function (_self, e)
412 Roo.MessageBox.alert("Downloading", "File is downloading");
416 '|xns' : 'Roo.Toolbar'
420 text : _this._strings['c550aeed26e71a81a88360c1889245ab'] /* Upload Values */,
422 click : function (_self, e)
425 var s = _this.egrid.getSelectionModel().getSelectedCell();
429 Roo.MessageBox.alert("Error", "Select a pulldown");
432 var d = _this.egrid.dataSource.getAt(s[0]);
435 var etype = d.data.name;
438 Roo.MessageBox.alert('Error', 'Please select a pulldown');
442 Pman.Dialog.Image.show(
444 _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})
448 _this.grid.footer.onClick('first');
454 '|xns' : 'Roo.Toolbar'
465 cls : 'x-btn-text-icon',
466 icon : rootURL + '/Pman/templates/images/search.gif',
467 text : _this._strings['d9ec74f5aa29ceef6bf7b45f7fec5d0f'] /* Add Value */,
472 // if we do not have a selected type... - what should we show..?
475 var s = _this.egrid.getSelectionModel().getSelectedCell();
479 Roo.MessageBox.alert("Error", "Select a pulldown");
482 var d = _this.egrid.dataSource.getAt(s[0]);
485 var ds = _this.grid.getDataSource();
487 var add = ds.reader.newRow({
498 _this.grid.startEditing(0, _this.grid.colModel.findColumnIndex('name')); // name...
502 '|xns' : 'Roo.Toolbar'
506 cls : 'x-btn-text-icon',
507 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
508 text : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
513 // if we do not have a selected type... - what should we show..?
515 var et = _this.etypeCombo.getValue();
518 Roo.MessageBox.alert("Error", "Select a pulldown");
523 var sc = _this.egrid.getSelectionModel().getSelectedCell();
526 Roo.MessageBox.alert("Error", "Select a pulldown");
530 var ds = _this.egrid.ds.getAt(sc[0]);
533 Roo.MessageBox.alert("Error", "Select enum");
538 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
539 _this.grid.footer.onClick('first');
545 '|xns' : 'Roo.Toolbar'
549 fieldLabel : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'] /* Search */,
552 render : function (_self)
554 _this.searchBox = this;
563 icon : rootURL + '/Pman/templates/images/search.gif',
565 click : function (_self, e)
567 _this.grid.footer.onClick('first');
571 '|xns' : 'Roo.Toolbar'
576 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
578 click : function (_self, e)
580 _this.searchBox.setValue('');
581 _this.grid.footer.onClick('first');
585 '|xns' : 'Roo.Toolbar'
590 '|xns' : 'Roo.Toolbar'
594 cls : 'x-btn-text-icon',
595 icon : rootURL + '/Pman/templates/images/trash.gif',
596 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
601 _this.grid.dataSource.each(function(rr) {
603 ids.push(rr.data.id);
607 Roo.MessageBox.alert("Error", "Select rows by clicking on the Internal# column");
611 Roo.MessageBox.confirm(
613 "Confirm Deletion of selected rows (some rows can not be deleted if they are referenced elsewhere",
620 url : baseURL + '/Roo/Core_enum',
622 _delete : ids.join(',')
624 success : function() {
625 _this.grid.footer.onClick('refresh');
635 '|xns' : 'Roo.Toolbar'
640 '|xns' : 'Roo.Toolbar'
644 cls : 'x-btn-text-icon',
645 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
646 text : _this._strings['1a87a3d29199e3435b8fb314624c008f'] /* Merge Option */,
651 var s = _this.grid.getSelectionModel().getSelections();
654 Roo.MessageBox.alert("Error", "Select a Row");
658 var d = _this.grid.ds.getAt(s[0]);
660 Pman.Dialog.AdminEnumMerge.show(d.data, function() {
661 _this.grid.footer.onClick('refresh');
667 '|xns' : 'Roo.Toolbar'
674 sortInfo : { field : 'etype', direction: 'ASC' },
676 beforeload : function (_self, options)
679 var s = _this.egrid.getSelectionModel().getSelectedCell();
685 var d = _this.egrid.dataSource.getAt(s[0]);
687 options.params.etype = d.data.name;
688 options.params['query[search]'] = _this.searchBox.getValue();
689 if (!options.params.etype.length) {
693 update : function (_self, record, operation)
695 if (operation != Roo.data.Record.COMMIT) {
700 url : baseURL + '/Roo/Core_enum.php',
704 etype : _this.grid.ds.getById(record.id).data.etype,
705 name : record.data.name,
706 active : record.data.active,
707 seqid : record.data.seqid,
708 display_name : record.data.display_name
710 success : function(res) {
712 // update the ID if it's not set..
713 if (record.data.id * 1 < 1) {
714 record.set('id', res.data.id);
726 url : baseURL + '/Roo/core_enum.php',
731 xtype : 'JsonReader',
756 totalProperty : 'total',
763 xtype : 'ColumnModel',
765 header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'] /* Internal # */,
766 renderer : function(v,x,r) {
769 fmt = '<span style="color:orange;font-weight:bold;">{0}</span>';
771 return String.format(fmt, v); },
778 xtype : 'ColumnModel',
779 dataIndex : 'images_id_id',
780 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
781 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); },
787 xtype : 'ColumnModel',
789 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
790 renderer : function(v) { return String.format('{0}', v); },
796 xtype : 'GridEditor',
807 xtype : 'ColumnModel',
808 dataIndex : 'display_name',
809 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
810 renderer : function(v) { return String.format('{0}', v); },
816 xtype : 'GridEditor',
827 xtype : 'ColumnModel',
828 dataIndex : 'active',
829 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
830 renderer : function(v) {
831 var state = v> 0 ? '-checked' : '';
833 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
842 xtype : 'ColumnModel',
844 header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'] /* Order # */,
845 renderer : function(v) { return String.format('{0}', v); },
851 xtype : 'GridEditor',
855 xtype : 'NumberField',
856 allowDecimals : false,
857 allowNegative : true,
858 decimalPrecision : 0,