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 'd1228f5476d15142b1358ae4b5fa2454' :"Order #",
12 'fdff10eac021dfbb69e9c38204237fdc' :"Add new pulldown list",
13 '1206eb8aea05be4625371c9c12818785' :"Pulldown",
14 '801ab24683a4a8c433c6eb40c48bcd9d' :"Download",
15 '7af54708cf5a4286cf0cfa58ff5148a8' :"Internal #",
16 'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
17 '1a87a3d29199e3435b8fb314624c008f' :"Merge Option",
18 'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
19 '510bc6e58593b2b8002c9fe0c21f3fde' :"Displaying core_enum{0} - {1} of {2}",
20 '1ba4d808fc7b27a7f60ce2ff75a8af3a' :"No core_enum found",
21 'c550aeed26e71a81a88360c1889245ab' :"Upload Values",
22 'd9ec74f5aa29ceef6bf7b45f7fec5d0f' :"Add Value",
23 'b9c49611cfda3259a2b837b39489e650' :"Add Image",
24 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
25 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
26 '49ee3087348e8d44e1feda1917443987' :"Name",
27 '7215ee9c7d9dc229d2921a40e899ec5f' :" "
30 part : ["Admin", "Enum" ],
31 order : '500-Pman.Tab.AdminEnum',
33 parent : 'Pman.Tab.Admin',
34 name : "Pman.Tab.AdminEnum",
48 xtype : 'LayoutRegion'
53 xtype : 'LayoutRegion'
57 xtype : 'BorderLayout',
65 url : baseURL + '/Roo/core_enum.php',
95 totalProperty : 'total',
101 sortInfo : { field : 'etype', direction: 'ASC' },
105 beforeload : function (_self, o)
107 o.params['query[empty_etype]'] = 1;
110 update : function (_self, record, operation)
112 if (operation != Roo.data.Record.COMMIT) {
117 url : baseURL + '/Roo/Core_enum.php',
121 etype : _this.grid.ds.getById(record.id).data.etype,
122 name : record.data.name,
123 active : record.data.active,
124 seqid : record.data.seqid,
125 display_name : record.data.display_name
127 success : function(res) {
129 // update the ID if it's not set..
130 if (record.data.id * 1 < 1) {
131 record.set('id', res.data.id);
146 xtype : 'CellSelectionModel',
148 selectionchange : function (_self, selection)
150 _this.grid.footer.onClick('first');
157 displayMsg : _this._strings['7215ee9c7d9dc229d2921a40e899ec5f'],
158 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'],
161 xtype : 'PagingToolbar'
169 '|xns' : 'Roo.Toolbar',
170 cls : 'x-btn-text-icon',
171 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
172 text : _this._strings['fdff10eac021dfbb69e9c38204237fdc'],
185 Pman.Dialog.AdminEnumType.show(data,function(){
187 _this.egrid.footer.onClick('first');
199 autoExpandColumn : 'display_name',
203 xtype : 'EditorGrid',
207 dataIndex : 'display_name',
208 header : _this._strings['1206eb8aea05be4625371c9c12818785'],
209 renderer : function(v,x,r) {
212 return String.format('<span qtip="{1}">{0}</span>', (''+v).length ? v : r.data.name, r.data.name);
216 xtype : 'ColumnModel'
220 dataIndex : 'active',
221 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
222 renderer : function(v) {
223 var state = v> 0 ? '-checked' : '';
225 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
230 xtype : 'ColumnModel'
234 afteredit : function (e)
238 beforeedit : function (e)
240 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
244 cellclick : function (_self, rowIndex, columnIndex, e)
247 var di = this.colModel.getDataIndex(columnIndex);
248 if (di != 'active') {
252 var rec = _this.grid.ds.getAt(rowIndex);
254 rec.set('active', rec.data.active ? 0 : 1);
259 celldblclick : function (_self, rowIndex, columnIndex, e)
261 var rec = _this.egrid.ds.getAt(rowIndex);
262 Pman.Dialog.AdminEnumType.show(rec.data,function(){
264 _this.egrid.footer.onClick('first');
270 //_this.dialog = Pman.Dialog.FILL_IN
271 if (_this.epanel.active) {
272 this.footer.onClick('first');
284 tableName : 'core_enum',
285 title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
289 activate : function() {
292 // _this.egrid.footer.onClick('first');
307 url : baseURL + '/Roo/core_enum.php',
337 totalProperty : 'total',
343 sortInfo : { field : 'etype', direction: 'ASC' },
347 beforeload : function (_self, options)
350 var s = _this.egrid.getSelectionModel().getSelectedCell();
356 var d = _this.egrid.dataSource.getAt(s[0]);
358 options.params.etype = d.data.name;
359 options.params['query[search]'] = _this.searchBox.getValue();
360 if (!options.params.etype.length) {
364 update : function (_self, record, operation)
366 if (operation != Roo.data.Record.COMMIT) {
371 url : baseURL + '/Roo/Core_enum.php',
375 etype : _this.grid.ds.getById(record.id).data.etype,
376 name : record.data.name,
377 active : record.data.active,
378 seqid : record.data.seqid,
379 display_name : record.data.display_name
381 success : function(res) {
383 // update the ID if it's not set..
384 if (record.data.id * 1 < 1) {
385 record.set('id', res.data.id);
400 displayMsg : _this._strings['510bc6e58593b2b8002c9fe0c21f3fde'],
401 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'],
404 xtype : 'PagingToolbar',
407 '|xns' : 'Roo.Toolbar',
408 text : _this._strings['801ab24683a4a8c433c6eb40c48bcd9d'],
412 click : function (_self, e)
417 Roo.MessageBox.alert("Downloading", "File is downloading");
422 '|xns' : 'Roo.Toolbar',
423 text : _this._strings['c550aeed26e71a81a88360c1889245ab'],
427 click : function (_self, e)
430 var s = _this.egrid.getSelectionModel().getSelectedCell();
434 Roo.MessageBox.alert("Error", "Select a pulldown");
437 var d = _this.egrid.dataSource.getAt(s[0]);
440 var etype = d.data.name;
443 Roo.MessageBox.alert('Error', 'Please select a pulldown');
447 Pman.Dialog.Image.show(
449 _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})
453 _this.grid.footer.onClick('first');
468 '|xns' : 'Roo.Toolbar',
469 cls : 'x-btn-text-icon',
470 icon : baseURL + '/Pman/templates/images/search.gif',
471 text : _this._strings['d9ec74f5aa29ceef6bf7b45f7fec5d0f'],
478 // if we do not have a selected type... - what should we show..?
481 var s = _this.egrid.getSelectionModel().getSelectedCell();
485 Roo.MessageBox.alert("Error", "Select a pulldown");
488 var d = _this.egrid.dataSource.getAt(s[0]);
491 var ds = _this.grid.getDataSource();
493 var add = ds.reader.newRow({
504 _this.grid.startEditing(0, _this.grid.colModel.getIndexByDataIndex('name')); // name...
509 '|xns' : 'Roo.Toolbar',
510 cls : 'x-btn-text-icon',
511 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
512 text : _this._strings['b9c49611cfda3259a2b837b39489e650'],
519 // if we do not have a selected type... - what should we show..?
520 var et = _this.etypeCombo.getValue();
523 Roo.MessageBox.alert("Error", "Select a pulldown");
526 var sc = _this.grid.getSelectionModel().getSelectedCell();
528 var ds = _this.grid.ds.getAt(sc[0]);
530 Roo.MessageBox.alert("Error", "Select enum");
535 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
536 _this.grid.footer.onClick('first');
544 fieldLabel : 'Search',
549 render : function (_self)
551 _this.searchBox = this;
556 '|xns' : 'Roo.Toolbar',
558 icon : rootURL + '/Pman/templates/images/search.gif',
562 click : function (_self, e)
564 _this.grid.footer.onClick('first');
569 '|xns' : 'Roo.Toolbar',
571 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
575 click : function (_self, e)
577 _this.searchBox.setValue('');
578 _this.grid.footer.onClick('first');
583 '|xns' : 'Roo.Toolbar',
588 '|xns' : 'Roo.Toolbar',
589 cls : 'x-btn-text-icon',
590 icon : rootURL + '/Pman/templates/images/trash.gif',
591 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
598 _this.grid.dataSource.each(function(rr) {
600 ids.push(rr.data.id);
604 Roo.MessageBox.alert("Error", "Select rows by clicking on the Internal# column");
608 Roo.MessageBox.confirm(
610 "Confirm Deletion of selected rows (some rows can not be deleted if they are referenced elsewhere",
617 url : baseURL + '/Roo/Core_enum',
619 _delete : ids.join(',')
621 success : function() {
622 _this.grid.footer.onClick('refresh');
633 '|xns' : 'Roo.Toolbar',
638 '|xns' : 'Roo.Toolbar',
639 cls : 'x-btn-text-icon',
640 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
641 text : _this._strings['1a87a3d29199e3435b8fb314624c008f'],
647 var s = _this.grid.getSelectionModel().getSelectedCell();
650 Roo.MessageBox.alert("Error", "Select a Row");
656 var d = _this.grid.ds.getAt(s[0]);
658 Pman.Dialog.AdminEnumMerge.show(s[0].data, function() {
659 _this.grid.footer.onClick('first');
669 autoExpandColumn : 'display_name',
673 xtype : 'EditorGrid',
678 header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'],
679 renderer : function(v,x,r) {
682 fmt = '<span style="color:orange;font-weight:bold;">{0}</span>';
684 return String.format(fmt, v); },
688 xtype : 'ColumnModel'
692 dataIndex : 'images_id_id',
693 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'],
694 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); },
697 xtype : 'ColumnModel'
708 xtype : 'GridEditor',
716 header : _this._strings['49ee3087348e8d44e1feda1917443987'],
717 renderer : function(v) { return String.format('{0}', v); },
721 xtype : 'ColumnModel',
736 xtype : 'GridEditor',
743 dataIndex : 'display_name',
744 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'],
745 renderer : function(v) { return String.format('{0}', v); },
749 xtype : 'ColumnModel',
757 dataIndex : 'active',
758 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
759 renderer : function(v) {
760 var state = v> 0 ? '-checked' : '';
762 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
768 xtype : 'ColumnModel'
774 allowDecimals : false,
775 allowNegative : true,
776 decimalPrecision : 0,
778 xtype : 'NumberField'
782 xtype : 'GridEditor',
790 header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'],
791 renderer : function(v) { return String.format('{0}', v); },
796 xtype : 'ColumnModel',
804 afteredit : function (e)
808 beforeedit : function (e)
810 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
814 cellclick : function (_self, rowIndex, columnIndex, e)
817 var di = this.colModel.getDataIndex(columnIndex);
818 var rec = _this.grid.ds.getAt(rowIndex);
820 if (di == 'active') {
822 rec.set('active', rec.data.active ? 0 : 1);
828 if (!e.ctrlKey && !e.shiftKey) { // shift or control not pressed -clear selection.
830 this.dataSource.each(function(rr) {
836 if (this.last_selected && e.shiftKey) {
837 // the highlight all the lines between the one last selected, and this one.
838 var s = this.dataSource.indexOf(this.last_selected);
839 var e = this.dataSource.indexOf(rec);
840 var ss = Math.min(s,e);
841 var ee = Math.max(s,e) +1;
842 for(var i = ss; i < ee; i++) {
843 var rr = this.dataSource.getAt(i);
847 this.last_selected = rec;
852 rec.selected = rec.selected ? 0 : 1;
853 this.last_selected = rec.selected ? rec : false;
854 rec.set('sel', rec.data.sel ? 0 : 1);
861 keypress : function (e)
864 _this.grid.footer.onClick('first');
870 //_this.dialog = Pman.Dialog.FILL_IN
871 if (_this.panel.active) {
872 this.footer.onClick('first');
885 tableName : 'core_enum',
886 title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
890 activate : function() {
893 _this.grid.footer.onClick('first');
907 title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
909 xtype : 'NestedLayoutPanel',