', '', '', '

' + this.mainTitle + '

', '', '', headings, '', '', '', body, '', pluginsBodyMarkup.join(''), '{% if (this.isGrouped && xindex > 0) break; %}', '', '', '', '', '{[ this.renderSummary(values, xindex) ]}', '', '', '', '
', '', '', { isGrouped : isGrouped, grid : grid, columns : columns, hasSummary : Ext.isObject(summaryFeature), summaryFeature : summaryFeature, expanderTemplate : expanderTemplate, renderColumn: function(column, value, rcd, col) { var meta = { 'align' : column.align, 'cellIndex' : col, 'classes' : [], 'column' : column, 'innerCls' : '', 'record' : rcd, 'recordIndex' : grid.store.indexOf(rcd), 'style' : '', 'tdAttr' : '', 'tdCls' : '', 'unselectableAttr' : 'unselectable="on"', 'value' : value }; if (column.xtype == 'templatecolumn') { value = column.tpl ? column.tpl.apply(rcd.data) : value; } else if (column.renderer) value = column.renderer.call(this.grid, value, meta, rcd, -1, col - 1, this.grid.store, this.grid.view); return this.getHtml(value, meta); }, applyTpl: function(rcd) { var html = this.expanderTemplate.apply(rcd.data); return html; }, renderSummary: function(column, colIndex) { var value; if (this.summaryFeature.remoteRoot) { var summaryRecord = this.summaryFeature.summaryRecord || (new this.grid.view.store.model(null, this.grid.view.id + '-summary-record')); if (this.grid.view.store.proxy.reader.rawData) { if (Ext.isArray(this.grid.view.store.proxy.reader.rawData[this.summaryFeature.remoteRoot])) summaryRecord.set(this.grid.view.store.proxy.reader.rawData[this.summaryFeature.remoteRoot][0]); else summaryRecord.set(this.grid.view.store.proxy.reader.rawData[this.summaryFeature.remoteRoot]); } value = summaryRecord.get(column.dataIndex); } else { value = this.getSummary(this.grid.store, column.summaryType, column.dataIndex, false); } if (column.summaryRenderer) { var summaryObject; if (Ext.getVersion().isLessThan('4.2.0')) { summaryObject = this.getSummaryObject(column.align); value = column.summaryRenderer.call(column, value, summaryObject, column.dataIndex); return this.getHtml(value, summaryObject); } else { var summaryRcd = this.getSummaryRecord42(); var summaryObject = this.getSummaryObject42(value, column, colIndex, summaryRcd); value = column.summaryRenderer.call(this.grid, value, summaryObject, summaryRcd, -1, colIndex, this.grid.store, this.grid.view); return this.getHtml(value, summaryObject); } } else { var meta = this.getSummaryObject42(column, colIndex); if (value === undefined || value == 0) return this.getHtml(" ", meta); else return this.getHtml(value, meta); } }, getSummaryObject: function(align) { var summaryValues = {}; for (var i = 0; i < columns.length; i++) { var valueObject = this.getSummary(this.grid.store, this.columns[i].summaryType, this.columns[i].dataIndex, false); if (valueObject === undefined) continue; // Do nothing else summaryValues[columns[i].id] = valueObject; } summaryValues['style'] = "text-align:" + align + ';'; return summaryValues; }, getSummaryRecord42: function() { if (this.summaryFeature.remoteRoot) { var summaryRecord = this.summaryFeature.summaryRecord || (new this.grid.view.store.model(null, this.grid.view.id + '-summary-record')); if (this.grid.view.store.proxy.reader.rawData) { if (Ext.isArray(this.grid.view.store.proxy.reader.rawData[this.summaryFeature.remoteRoot])) summaryRecord.set(this.grid.view.store.proxy.reader.rawData[this.summaryFeature.remoteRoot][0]); else summaryRecord.set(this.grid.view.store.proxy.reader.rawData[this.summaryFeature.remoteRoot]); } return summaryRecord; } var rcd = Ext.create(this.grid.store.model); for (var i = 0; i < this.columns.length; i++) { var valueObject = this.getSummary(this.grid.store, this.columns[i].summaryType, this.columns[i].dataIndex, false); if (valueObject === undefined) continue; // Do nothing else rcd.set(this.columns[i].dataIndex, valueObject); } return rcd; }, getSummaryObject42: function(value, column, colIndex, rcd) { return { align : column.align, cellIndex: colIndex, 'column': column, classes: [], innerCls: '', record : rcd, recordIndex: -1, style : '', tdAttr : '', tdCls : '', unselectableAttr : 'unselectable="on"', 'value' : value }; }, // Use the getSummary from Ext 4.1.3. This function for 4.2.1 has been changed without updating the documentation // In 4.2.1, group is a group object from the store (specifically grid.store.groups[i].items). /** * Get the summary data for a field. * @private * @param {Ext.data.Store} store The store to get the data from * @param {String/Function} type The type of aggregation. If a function is specified it will * be passed to the stores aggregate function. * @param {String} field The field to aggregate on * @param {Boolean} group True to aggregate in grouped mode * @return {Number/String/Object} See the return type for the store functions. */ getSummary: function(store, type, field, group) { if (type) { if (Ext.isFunction(type)) { return store.aggregate(type, null, group, [field]); } switch (type) { case 'count': return store.count(group); case 'min': return store.min(field, group); case 'max': return store.max(field, group); case 'sum': return store.sum(field, group); case 'average': return store.average(field, group); default: return group ? {} : ''; } } }, getHtml: function(value, meta) { if (value == undefined) value = ' '; var html = ''; return html; } } ]; // var html = Ext.create('Ext.XTemplate', htmlMarkup).apply(data); var records = grid.store.getRange(); var html = Ext.create('Ext.XTemplate', htmlMarkup).apply(records); //open up a new printing window, write to it, print it and close var win = window.open('', 'printgrid'); //document must be open and closed win.document.open(); win.document.write(html); win.document.close(); if (this.printAutomatically){ win.print(); } //Another way to set the closing of the main if (this.closeAutomaticallyAfterPrint){ if(Ext.isIE){ window.close(); } else { win.close(); } } }, // getFeature : function( grid, featureId ) { // var feature; // var view = grid.getView(); // if ( featureId ) { // feature = view.getFeature( featureId ); // } // else { // var features = view.features; // if ( features.length > 1 ) { // alert( "More than one feature requires to pass " + // "featureId as parameter to 'print'." ); // return; // } // else { // feature = features[0]; // } // } // return feature; // }, getFeature : function( grid, featureFType) { var view = grid.getView(); var features = view.features; if (features) for (var i = 0; i ', '', '', '{[ this.applyGroupTpl(values) ]}', '', '', '', '', '', '{[ this.renderColumn(values, parent.get(values.dataIndex), parent, xindex) ]}', '', '', '', '', '', '', '{[ this.renderSummary(values, xindex) ]}', '', '', '', '', { // XTemplate configuration: columns : columns, groupColumn : groupColumn, colSpan : columns.length, grid : grid, groupName : "", groupTpl : feature.groupHeaderTpl, hasSummary : Ext.isObject(groupingSummaryFeature) && groupingSummaryFeature.showSummaryRow, summaryFeature : groupingSummaryFeature, // XTemplate member functions: childCount : function(c) { return c.length; }, renderColumn: function(column, value, rcd, col) { var meta = { 'align' : column.align, 'cellIndex' : col, 'classes' : [], 'column' : column, 'innerCls' : '', 'record' : rcd, 'recordIndex' : grid.store.indexOf(rcd), 'style' : '', 'tdAttr' : '', 'tdCls' : '', 'unselectableAttr' : 'unselectable="on"', 'value' : value }; if (column.renderer) value = column.renderer.call(this.grid, value, meta, rcd, -1, col - 1, this.grid.store, this.grid.view); return this.getHtml(value, meta); }, getHtml: function(value, meta) { if (value == undefined || value == 0) value = ' '; var html = ''; return html; }, renderSummary: function(column, colIndex) { var value; var summaryObject; if (this.summaryFeature.remoteRoot) { var summaryRecord = this.summaryFeature.summaryRecord || (new this.grid.view.store.model(null, this.grid.view.id + '-summary-record')); if (this.grid.view.store.proxy.reader.rawData) { if (Ext.isArray(this.grid.view.store.proxy.reader.rawData[this.summaryFeature.remoteRoot])) summaryRecord.set(this.getSummaryRcd(this.grid.view.store.proxy.reader.rawData[this.summaryFeature.remoteRoot], this.grid.store.groupField, this.groupName)); else summaryRecord.set(this.grid.view.store.proxy.reader.rawData[this.summaryFeature.remoteRoot]); } value = summaryRecord.get(column.dataIndex); } else { value = this.getSummary(this.grid.store, column.summaryType, column.dataIndex, this.grid.store.isGrouped()); } if (Ext.isObject(value)) value = value[this.groupName]; if (column.summaryRenderer) if (Ext.getVersion().isLessThan('4.2.0')) { value = column.summaryRenderer.call(column, value, this.getSummaryObject(column.align), column.dataIndex); } else { summaryObject = this.getSummaryObject42(column, colIndex); value = column.summaryRenderer.call(this.grid, value, this.getSummaryObject42(column, colIndex), this.getSummaryRecord42(), -1, colIndex, this.grid.store, this.grid.view); return this.getHtml(value, summaryObject); } else if (value == undefined || value == 0) value = ' '; return '
' + value + '
'; }, applyGroupTpl: function(rcd) { // The only members in rcd are name and children this.groupName = rcd.name; rcd.groupField = this.grid.store.groupField; var meta = { 'align' : '', 'cellIndex' : -1, 'classes' : [], 'column' : this.groupColumn, 'innerCls' : '', 'record' : rcd.children[0], 'recordIndex' : this.grid.store.indexOf(rcd.children[0]), 'style' : '', 'tdAttr' : '', 'tdCls' : '', 'unselectableAttr' : 'unselectable="on"', 'value' : rcd.name }; if (this.groupColumn) rcd.columnName = this.groupColumn.text; else rcd.columnName = this.groupField; rcd.groupValue = rcd.name; if (this.groupColumn && this.groupColumn.renderer) { rcd.renderedGroupValue = this.groupColumn.renderer.call(this.grid, rcd.name, meta, rcd.children[0], -1, -1, this.grid.store, this.grid.view); } else rcd.renderedGroupValue = rcd.name; rcd.rows = null; // We don't support rcd.rows yet return this.groupTpl.apply(rcd); }, getSummaryObject: function(align) { var summaryValues = {}; for (var i = 0; i < this.columns.length; i++) { var valueObject = this.getSummary(this.grid.store, this.columns[i].summaryType, this.columns[i].dataIndex, this.grid.store.isGrouped()); if (valueObject === undefined) continue; // Do nothing else if (Ext.isObject(valueObject)) summaryValues[columns[i].id] = valueObject[this.groupName]; else summaryValues[columns[i].id] = valueObject; } summaryValues['style'] = "text-align:" + align + ';'; return summaryValues; }, getSummaryRecord42: function() { var rcd = Ext.create(this.grid.store.model); for (var i = 0; i < this.columns.length; i++) { var valueObject = this.getSummary(this.grid.store, this.columns[i].summaryType, this.columns[i].dataIndex, this.grid.store.isGrouped()); if (valueObject === undefined) continue; // Do nothing else if (Ext.isObject(valueObject)) rcd.set(this.columns[i].dataIndex, valueObject[this.groupName]); else rcd.set(this.columns[i].dataIndex, valueObject); } return rcd; }, getSummaryObject42: function(column, colIndex) { return { align : column.align, cellIndex: colIndex, classes: [], innerCls: '', record : this.getSummaryRecord42(), recordIndex: -1, style : '', tdAttr : '', tdCls : '', unselectableAttr : 'unselectable="on"', value : ' ' }; }, // Use the getSummary from Ext 4.1.3. This function for 4.2.1 has been changed without updating the documentation // In 4.2.1, group is a group object from the store (specifically grid.store.groups[i].items). /** * Get the summary data for a field. * @private * @param {Ext.data.Store} store The store to get the data from * @param {String/Function} type The type of aggregation. If a function is specified it will * be passed to the stores aggregate function. * @param {String} field The field to aggregate on * @param {Boolean} group True to aggregate in grouped mode * @return {Number/String/Object} See the return type for the store functions. */ getSummary: function(store, type, field, group) { if (type) { if (Ext.isFunction(type)) { return store.aggregate(type, null, group, [field]); } switch (type) { case 'count': return store.count(group); case 'min': return store.min(field, group); case 'max': return store.max(field, group); case 'sum': return store.sum(field, group); case 'average': return store.average(field, group); default: return group ? {} : ''; } } }, // return the record having fieldName == value getSummaryRcd : function(rawDataObject, fieldName, value) { if (Ext.isArray(rawDataObject)) { for (var i = 0; i < rawDataObject.length; i++) { if (rawDataObject[i][fieldName] && rawDataObject[i][fieldName] == value) return rawDataObject[i]; } return undefined; } else if (rawDataObject.data[fieldName]) return rawDataObject; else return undefined; } } ]; body = Ext.create('Ext.XTemplate', bodyTpl).apply(groups); } else { var bodyTpl = [ '', '{[ this.renderColumn(values, parent.get(values.dataIndex), parent, xindex) ]}', '' ]; body = bodyTpl.join(''); } return body; }, /** * @property stylesheetPath * @type String * The path at which the print stylesheet can be found (defaults to 'ux/grid/gridPrinterCss/print.css') */ stylesheetPath: null, /** * @property printAutomatically * @type Boolean * True to open the print dialog automatically and close the window after printing. False to simply open the print version * of the grid (defaults to false) */ printAutomatically: false, /** * @property closeAutomaticallyAfterPrint * @type Boolean * True to close the window automatically after printing. * (defaults to false) */ closeAutomaticallyAfterPrint: false, /** * @property pageTitle * @type String * Title to be used on top of the table * (defaults to empty) */ pageTitle: 'Print View', /** * @property mainTitle * @type String * Title to be used on top of the table * (defaults to empty) */ mainTitle: '', /** * Text show on print link * @property printLinkText * @type String */ printLinkText: 'Print', /** * Text show on close link * @property closeLinkText * @type String */ closeLinkText: 'Close', /** * @property headerTpl * @type {Object/Array} values * The markup used to create the headings row. By default this just uses elements, override to provide your own */ headerTpl: [ '', '{text}', '' ], /** * @property bodyTpl * @type {Object/Array} values * The XTemplate used to create each row. This is used inside the 'print' function to build another XTemplate, to which the data * are then applied (see the escaped dataIndex attribute here - this ends up as "{dataIndex}") */ bodyTpl: [ '', '\{\[ this.renderColumn(values, parent.get(values.dataIndex), parent, xindex) \]\}', '' ] } }); Ext.define("JGrid.view.JGridHelp", { extend : "Ext.window.Window", alias : "widget.JGridHelp", layout: "fit", closeAction: "hide", minimizable: true, maximizable: true, tbar: [ { xtype: 'button', text: "HELP_INDEX", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/lightbulb.png", tooltip: "FULL_INDEXED_HELP_TOPICS_ON_USING_JGRID", handler: function () { window.open("http://www.datagrids.clubsareus.org/images/stories/HelpDocs/JGridHelp.htm"); } } ], renderTo: "jgrid_module6", title: "HELP_INSTRUCTIONS", tooltip: "HELP_INSTRUCTIONS_TOOLTIP", items: { // xtype: "iframepanel", xtype: "uxiframe", src: "https://www.edili.com/administrator/components/com_jgrid/help/en-GB/jgrid_site_helpfile.html",width: 705,height: 650 } }); //help access rules and roles panels Ext.define("JGrid.view.JGridHelpAccess", { extend : "Ext.window.Window", alias : "widget.JGridHelpAccess", id: "JGridHelpAccess", renderTo: "jgrid_module6", tbar: [ { xtype: 'button', text: "HELP_INDEX", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/lightbulb.png", tooltip: "FULL_INDEXED_HELP_TOPICS_ON_USING_JGRID", handler: function () { window.open("http://www.datagrids.clubsareus.org/images/stories/HelpDocs/JGridHelp.htm"); } } ], title: "HELP_INSTRUCTIONS", tooltip: "HELP_INSTRUCTIONS_TOOLTIP", closeAction: 'hide', minimizable: true, maximizable: true, items: { // xtype: "iframepanel", xtype: "uxiframe", src: "https://www.edili.com/administrator/components/com_jgrid/help/en-GB/jgrid_admin_access_helpfile.html",width: 695,height: 600 ,autoRender: true } }); Ext.define("JGrid.model.JGridDocumentModel0", { extend: "Ext.data.Model", alias : "widget.JGridDocumentModel0", idProperty:"JGridDocumentModel0", id:"JGridDocumentModel0", fields: ["id", "document_title","document_type"], proxy: { type: "rest", url: "https://www.edili.com/index.php?option=com_jgrid&task=read_combo&controller=jgrid_documents&format=ajax&grid_id=20", reader: new Ext.data.JsonReader({ root: "rows", totalProperty: "results", id: "id" }, JGrid.dsDocumentModel[0]), writer: { type: "json", writeAllFields : false, //just send changed fields allowSingle :false //always wrap in an array } }});JGrid.dsDocumentModel[0] = Ext.create("JGrid.model.JGridDocumentModel0"); Ext.define("JGrid.model.JGridModel0", { extend: "Ext.data.Model", alias : "widget.JGridModel0", id:"JGridModel0", fields: [{name: "id", type: "int"},{name: "T118", type: "string"},{name: "T119", type: "string"},{name: "T120", type: "string"},{name: "T121", type: "string"},{name: "I198", type: "int"},{name: "T122", type: "string"},{name: "T124", type: "string"},{name: "T153", type: "string"},{name: "T154", type: "string"},{name: "U135", type: "string"},{name: "U155", type: "string"} ,{name: "editable_line"} ,{name: "slvl"} ,{name: "row_color"} ,{name: "formula"} ,{name: "rslvl_id", defaultValue: "D"}]});JGrid.dsModel[0] = Ext.create("JGrid.model.JGridModel0"); // manage grid user access jgrid_security administrator screen xtype: "editorgrid" Ext.define("JGrid.model.JGridModelAccess", { extend: "Ext.data.Model", alias : "widget.JGridModelAccess", id: "JGridModelAccess", fields: [ {name: 'id', type: 'int'}, {name: 'userid_assigning_access', type: 'int'}, {name: 'access_for', type: 'int'}, {name: 'access_for_id', type: 'string'}, {name: 'access_for_name', type: 'string'}, {name: 'access_type', type: 'int'}, {name: 'access_type_id', type: 'string'}, {name: 'access_type_name', type: 'string'}, {name: 'access_level', type: 'int'}, {name: 'last_updated', type: 'date'} ] }); JGrid.dsModel.ds_model_access = Ext.create("JGrid.model.JGridModelAccess"); // combo for selecting grid sheets Ext.define("JGrid.model.JGridComboModel1", { extend: "Ext.data.Model", fields: [ {name: 'grid_sheet_id', type: 'string'}, {name: 'grid_sheet_title', type: 'string'}, {name: 'document_type', type: 'int'} ], alias : "widget.JGridComboModel1", id:"JGridComboModel1" }); JGrid.dsComboModel[1] = Ext.create("JGrid.model.JGridComboModel1"); // combo for upload or download deliminator selection Ext.define("JGrid.model.JGridCModel2", { extend: "Ext.data.Model", fields: [ {name: 'delimiter', type: 'string'}, {name: 'delimiter_description', type: 'string'} ], alias : "widget.JGridCModel2", id:"JGridCModel2" }); JGrid.dsComboModel[2] = Ext.create("JGrid.model.JGridCModel2"); // combo boxs for popup image jump to sheet sheets Ext.define("JGrid.model.JGridCModel3", { extend: "Ext.data.Model", alias : "widget.JGridCModel3", id: "JGridCModel3", fields: [ {name: 'grid_sheet_id', type: 'string'}, {name: 'grid_sheet_title', type: 'string'} ] }); JGrid.dsCModel[3] = Ext.create("JGrid.model.JGridCModel3"); // combo boxs for security access for type role or user Ext.define("JGrid.model.JGridCModel40", { extend: "Ext.data.Model", alias : "widget.JGridCModel40", id: "JGridCModel40", fields: [{name: 'access_for', type: 'string'}, {name: 'Type', type: 'string'} ] }); JGrid.dsCModel[40] = Ext.create("JGrid.model.JGridCModel40"); // combo boxs for security role or user model Ext.define("JGrid.model.JGridCModel41", { extend: "Ext.data.Model", alias : "widget.JGridCModel41", id: "JGridCModel41", fields: [ {name: 'rslvl_id', type: 'string'}, {name: 'role_or_user', type: 'string'} ] }); JGrid.dsCModel[41] = Ext.create("JGrid.model.JGridCModel41"); // combo boxs for user access type grid, sheet, or column type Ext.define("JGrid.model.JGridCModel42", { extend: "Ext.data.Model", alias : "widget.JGridCModel42", id: "JGridCModel42", fields: [{name: 'access_type', type: 'string'}, {name: 'Type', type: 'string'} ] }); JGrid.dsCModel[42] = Ext.create("JGrid.model.JGridCModel42"); // combo boxs for user access grid, sheet, or column Ext.define("JGrid.model.JGridCModel43", { extend: "Ext.data.Model", alias : "widget.JGridCModel43", id: "JGridCModel43", fields: [ {name: 'access_type_id', type: 'string'}, {name: 'access_type_name', type: 'string'} ] }); JGrid.dsCModel[43] = Ext.create("JGrid.model.JGridCModel43"); // combo boxs for acess level Ext.define("JGrid.model.JGridCModel44", { extend: "Ext.data.Model", alias : "widget.JGridCModel44", id: "JGridCModel44", fields: [{name: 'access_level', type: 'string'}, {name: 'Type', type: 'string'} ] }); JGrid.dsCModel[44] = Ext.create("JGrid.model.JGridCModel44"); // combo boxs for security role or user Ext.define("JGrid.model.JGridCModel50", { extend: "Ext.data.Model", alias : "widget.JGridCModel50", id: "JGridCModel50", fields: [ {name: 'rslvl_id', type: 'string'}, {name: 'role_or_user', type: 'string'} ] }); JGrid.dsCModel[50] = Ext.create("JGrid.model.JGridCModel50"); // combo boxs userdefined column listbox Ext.define("JGrid.model.JGridCModel60", { extend: "Ext.data.Model", alias : "widget.JGridCModel60", id: "JGridCModel60", fields: [ {name: "id", type: 'string'}, {name: "listboxvalues", type: 'string'}, {name: "listboxvaluerowcolor", type: 'string'} ] }); JGrid.dsCModel[50] = Ext.create("JGrid.model.JGridCModel50"); // combo boxs for security role or user model Ext.define("JGrid.model.JGridCModel411", { extend: "Ext.data.Model", alias : "widget.JGridCModel411", id: "JGridCModel411", fields: [ {name: 'access_for_id', type: 'string'}, {name: 'access_for_name', type: 'string'} ] }); JGrid.dsCModel[411] = Ext.create("JGrid.model.JGridCModel411"); // combo boxs for user access grid, sheet, or column Ext.define("JGrid.model.JGridCModel431", { extend: "Ext.data.Model", alias : "widget.JGridCModel431", id: "JGridCModel431", fields: [ {name: 'access_type_id', type: 'string'}, {name: 'access_type_name', type: 'string'} ] }); JGrid.dsCModel[431] = Ext.create("JGrid.model.JGridCModel431"); JGrid.grid_application_name= "mod_jgrid6"; // combo box for application-grid-sheet Ext.define("JGrid.store.JGridComboStore1", { extend: "Ext.data.Store", requires: "JGrid.model.JGridComboModel1", model: "JGrid.model.JGridComboModel1", alias : "widget.JGridComboStore1", id:"JGridComboStore1", proxy: { type: "ajax", url: "https://www.edili.com/index.php?option=com_jgrid&task=get_combo_Application_Grid_Sheet&controller=jgrid_documents&grid_application_name=mod_jgrid6&format=ajax", reader: new Ext.data.JsonReader({ fields: [{name: 'grid_sheet_id', type: 'string'}, {name: 'grid_sheet_title', type: 'string'}, {name: 'document_type', type: 'int'}], root: 'rows', totalProperty: 'results', id: 'id' }) } }); JGrid.combo_store[1] = Ext.create("JGrid.store.JGridComboStore1"); // combo for upload or download deliminator selection Ext.define("JGrid.store.JGridCStore2", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel2", model: "JGrid.model.JGridCModel2", alias : "widget.JGridCStore2", storeId:"JGridCStore2", id:"JGridCStore2", autoLoad: false, data: [ {"delimiter": ",", "delimiter_description": "Virgola -> ,"}, {"delimiter": ";", "delimiter_description": "Punto e virgola -> ;"}, {"delimiter": "\t", "delimiter_description": "Tabulazione -> "}, {"delimiter": "|", "delimiter_description": "Pipe -> |"}, {"delimiter": ":", "delimiter_description": "Due punti -> :"} ]//comboData }); JGrid.combo_store[2] = Ext.create("JGrid.store.JGridCStore2"); // combo boxs for popup image jump to sheet sheets Ext.define("JGrid.store.JGridCStore3", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel3", model: "JGrid.model.JGridCModel3", alias : "widget.JGridCStore3", storeId:"JGridCStore3", id:"JGridCStore3", autoLoad: true, proxy: { type: "ajax", url: "https://www.edili.com/index.php?option=com_jgrid&task=get_combo_Application_Grid_Sheet&controller=jgrid_documents&grid_application_name=mod_jgrid6&format=ajax", reader: new Ext.data.JsonReader({ root: "rows", totalProperty: "results", id: "id" },JGrid.dsCModel[3]), writer: { type: "json", writeAllFields : false, //just send changed fields allowSingle :false //always wrap in an array } } }); JGrid.combo_store[3] = Ext.create("JGrid.store.JGridCStore3"); // combo boxs for security access for type role or user Ext.define("JGrid.store.JGridCStore40", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel40", model: "JGrid.model.JGridCModel40", alias : "widget.JGridCStore40", storeId:"JGridCStore40", id:"JGridCStore40", autoLoad: false, data: [ {"access_for":"1", "Type":"USER"}, {"access_for":"3", "Type":"ROLE"}, {"access_for":"3", "Type":"DEFAULT"}, {"access_for":"4", "Type":"CREATOR"} ]//comboData }); JGrid.combo_store[40] = Ext.create("JGrid.store.JGridCStore40"); // combo boxs for security role or user Ext.define("JGrid.store.JGridCStore41", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel41", model: "JGrid.model.JGridCModel41", alias : "widget.JGridCStore41", storeId:"JGridCStore41", id:"JGridCStore41", autoLoad: true, proxy: { type: "ajax", url: "https://www.edili.com/index.php?option=com_jgrid&task=access_for_name_id&controller=jgrid_security&grid_application_name=mod_jgrid6&format=ajax", reader: new Ext.data.JsonReader({ root: "rows", totalProperty: "results", id: "id" },JGrid.dsCModel[41]), writer: { type: "json", writeAllFields : false, //just send changed fields allowSingle :false //always wrap in an array } } }); JGrid.combo_store[41] = Ext.create("JGrid.store.JGridCStore41"); JGrid.combo_store[41].on('load', function () { //JGrid.JGridSecurity.getView().refresh(); }); // combo boxs for user access type grid, sheet, or column type Ext.define("JGrid.store.JGridCStore42", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel42", model: "JGrid.model.JGridCModel42", alias : "widget.JGridCStore42", storeId:"JGridCStore42", id:"JGridCStore42", autoLoad: false, data: [ {"access_type":"1", "Type":"GRID"}, {"access_type":"3", "Type":"GRID_COLUMN"}, {"access_type":"3", "Type":"SHEET"}, {"access_type":"4", "Type":"SHEET_COLUMN"} ]//comboData }); JGrid.combo_store[42] = Ext.create("JGrid.store.JGridCStore42"); // combo boxs for access type name Ext.define("JGrid.store.JGridCStore43", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel43", model: "JGrid.model.JGridCModel43", alias : "widget.JGridCStore43", storeId:"JGridCStore43", id:"JGridCStore43", autoLoad: true, proxy: { type: "ajax", url: "https://www.edili.com/index.php?option=com_jgrid&task=access_type_name_id&controller=jgrid_security&grid_application_name=mod_jgrid6&grid_id="+JGrid.gCurrentGridId+"&format=ajax", reader: new Ext.data.JsonReader({ root: "rows", totalProperty: "results", id: "id" },JGrid.dsCModel[43]), writer: { type: "json", writeAllFields : false, //just send changed fields allowSingle :false //always wrap in an array } } }); JGrid.combo_store[43] = Ext.create("JGrid.store.JGridCStore43"); // combo boxs for acess level Ext.define("JGrid.store.JGridCStore44", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel44", model: "JGrid.model.JGridCModel44", alias : "widget.JGridCStore44", storeId:"JGridCStore44", id:"JGridCStore44", autoLoad: false, data: [ {"access_level":"0", "Type":"JNO_ACCESS"}, {"access_level":"1", "Type":"VIEWER"}, {"access_level":"-1", "Type":"VIEW_DOWNLOAD"}, {"access_level":"2", "Type":"CELL_EDIT"}, {"access_level":"3", "Type":"ROW_EDITOR"}, {"access_level":"4", "Type":"ADD_DELETE_ROWS"}, {"access_level":"5", "Type":"SHEET_MANAGER"}, {"access_level":"6", "Type":"ACCESS_MANAGER"} ]//comboData }); JGrid.combo_store[44] = Ext.create("JGrid.store.JGridCStore44"); // combo boxs for security role or user Ext.define("JGrid.store.JGridCStore50", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel50", model: "JGrid.model.JGridCModel50", alias : "widget.JGridCStore50", storeId:"JGridCStore50", id:"JGridCStore50", autoLoad: true, proxy: { type: "ajax", url: "https://www.edili.com/index.php?option=com_jgrid&task=read_role_or_user&format=ajax", reader: new Ext.data.JsonReader({ root: "rows", totalProperty: "results", id: "id" },JGrid.dsCModel[50]), writer: { type: "json", writeAllFields : false, //just send changed fields allowSingle :false //always wrap in an array } } }); JGrid.combo_store[50] = Ext.create("JGrid.store.JGridCStore50"); JGrid.combo_store[50].load(); // combo boxs for security role or user Ext.define("JGrid.store.JGridCStore411", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel411", model: "JGrid.model.JGridCModel411", alias : "widget.JGridCStore411", storeId:"JGridCStore411", id:"JGridCStore411", autoLoad: true, proxy: { type: "ajax", url: "index.php?option=com_jgrid&task=access_for_name_id&controller=jgrid_security&format=ajax&access_for=0", reader: new Ext.data.JsonReader({ root: "rows", totalProperty: "results", id: "id" },JGrid.dsCModel[411]), writer: { type: "json", writeAllFields : false, //just send changed fields allowSingle :false //always wrap in an array } } }); JGrid.combo_store[411] = Ext.create("JGrid.store.JGridCStore411"); // combo boxs for user access grid, sheet, or column Ext.define("JGrid.store.JGridCStore431", { extend: "Ext.data.Store", requires: "JGrid.model.JGridCModel431", model: "JGrid.model.JGridCModel431", alias : "widget.JGridCStore431", storeId:"JGridCStore431", id:"JGridCStore431", autoLoad: true, proxy: { type: "ajax", url: "index.php?option=com_jgrid&task=access_type_name_id&controller=jgrid_security&grid_application_name=mod_jgrid6&grid_id="+JGrid.gCurrentGridId+"&format=ajax", reader: new Ext.data.JsonReader({ root: "rows", totalProperty: "results", id: "id" },JGrid.dsCModel[431]), writer: { type: "json", writeAllFields : false, //just send changed fields allowSingle :false //always wrap in an array } } }); JGrid.combo_store[431] = Ext.create("JGrid.store.JGridCStore431"); Ext.define("JGrid.store.JGridDocumentStore0", { extend: "Ext.data.Store", requires: "JGrid.model.JGridDocumentModel0", model: "JGrid.model.JGridDocumentModel0", alias : "widget.JGridDocumentStore0", storeId:"JGridDocumentStore0", id:"JGridDocumentStore0", autoLoad: true, proxy: { type: "ajax", url: "https://www.edili.com/index.php?option=com_jgrid&task=read_combo&controller=jgrid_documents&format=ajax&grid_id=20", reader: new Ext.data.JsonReader({ root: "rows", totalProperty: "results", id: "id" },JGrid.dsDocumentModel[0]), writer: { type: "json", writeAllFields : false, //just send changed fields allowSingle :false //always wrap in an array } } });JGrid.documentStore[0] = Ext.create("JGrid.store.JGridDocumentStore0"); Ext.define("JGrid.store.JGridChartStore", { extend: "Ext.data.Store", requires: "JGrid.model.JGridDocumentModel0", model: "JGrid.model.JGridDocumentModel0", alias : "widget.JGridChartStore", storeId:"JGridChartStore0", id:"JGridChartStore0", autoLoad: false, listeners: { load:function( storeObj, records, successful, eOpts){ for(var i=0;i"1") {} } , load: function (store,records, result, eOpts ) { if(store.getCount() < 1) { Ext.Msg.alert("Nessun risultato trovato."); return; } JGrid.dslvl[0]=store.getProxy().getReader().rawData.dslvl; JGrid.selectType[0]=store.getProxy().getReader().rawData.select_type; // if(!Ext.isEmpty(store.getProxy().getReader().rawData)) // { // JGrid.dslvl[0]=store.getProxy().getReader().rawData.dslvl; // } // else // { // JGrid.dslvl[0] = "D"; //RMS?? // } access_level_array0 = set_access_levels(0, "Grid-20", "Manage_Sheet_Access0", "Manage_Sheets0", "Add_Row_Above0", "Edit_Row0", JGrid.editMode[0] ); if(records[0].data.id=="0") { if(JGrid.dslvl[0][0]>1) { if(JGrid.editMode[0]==false) { Ext.ComponentMgr.get("Edit_Mode0").show(); } } else { Ext.ComponentMgr.get("Edit_Mode0").hide(); Ext.ComponentMgr.get("View_Mode0").hide(); } } access_level_array0 = set_access_levels(0, "Grid-20", "Manage_Sheet_Access0", "Manage_Sheets0", "Add_Row_Above0", "Edit_Row0", JGrid.editMode[0] ); if(access_level_array0[0] >="2") { if(JGrid.editMode[0]==false) { Ext.ComponentMgr.get("Edit_Mode0").show(); } } else { Ext.ComponentMgr.get("Edit_Mode0").hide(); Ext.ComponentMgr.get("View_Mode0").hide(); }Ext.ComponentMgr.get("Grid-20").on("validateedit", function(e){ e.value = Ext.util.Format.stripTags(e.value); }); } } });JGrid.store[0] = Ext.create("JGrid.store.JGridStore0"); // manage grid user access jgrid_security administrator screen xtype: "editorgrid" JGrid.proxy_access = Ext.create("Ext.data.HttpProxy", { type: "ajax", id: "proxy_access", api: { read: "https://www.edili.com/index.php?option=com_jgrid&task=read&controller=jgrid_security&grid_application_name=mod_jgrid6&format=ajax", create: "https://www.edili.com/index.php?option=com_jgrid&task=create&controller=jgrid_security&grid_application_name=mod_jgrid6&format=ajax", update: "https://www.edili.com/index.php?option=com_jgrid&task=update&controller=jgrid_security&grid_application_name=mod_jgrid6&format=ajax", destroy: "https://www.edili.com/index.php?option=com_jgrid&task=destroy&controller=jgrid_security&grid_application_name=mod_jgrid6&format=ajax" }, actionMethods: { create : "POST", read : "GET", update : "POST", destroy: "POST" }, reader: new Ext.data.JsonReader({ root:"rows", totalProperty: "total", successProperty: "success", id:"id" },JGrid.dsModel[4]), writer: { type: "json", encode: true, root:"rows", writeAllFields : false, //just send changed fields allowSingle :false, //always wrap in an array returnJson: true //RMS check this if needed } }); // manage grid user access jgrid_security administrator screen xtype: "editorgrid" Ext.define("JGrid.store.JGridStoreAccess", { extend: "Ext.data.Store", requires: "JGrid.model.JGridModelAccess", model: "JGrid.model.JGridModelAccess", alias : "widget.JGridStoreAccess", storeId:"JGridStoreAccess", id:"JGridStoreAccess", autoSync: true, autoLoad: false, autoSave: true, proxy: JGrid.proxy_access, sortInfo: { field: 'access_for_id', direction: 'ASC' }, groupField: 'access_for_id' }); JGrid.store_access = Ext.create("JGrid.store.JGridStoreAccess"); JGrid.store_access.on('write', function () { JGrid.JGridAccessRules.hide(); JGrid.JGridSecurity.getView().refresh(); }); JGrid.store_access.on('beforeload', function () { JGrid.combo_store[41].load({ params: { access_for: "0" } }); JGrid.combo_store[43].load({ params: { access_type: "0" } }); JGrid.combo_store[411].load({ params: { access_for: "0" } }); JGrid.combo_store[431].load({ params: { access_type: "0" } }); }); // combo for upload deliminator selection var combo1 = Ext.create('Ext.form.ComboBox', { typeAhead: true, width: 150, emptyText: "SELECT_A_TYPE", lazyRender: true, forceSelection: true, emptyText: "SELECT_A_DELIMITER", fieldLabel: "DELIMITER", plugins: [ new Ext.ux.FieldHelp("SELECT_A_DELIMITER_FOR_CSV_FILE") ], queryMode: 'local', store: JGrid.combo_store[2], valueField: "delimiter", displayField: "delimiter_description", id: "delimiter_comboo", selectOnFocus: true, typeAhead: true, editable: true }); // combo for download deliminator selection var combo2 = Ext.create('Ext.form.ComboBox', { typeAhead: true, width: 150, emptyText: "SELECT_A_TYPE", lazyRender: true, forceSelection: true, emptyText: "Scegli un delimitatore", fieldLabel: "Delimitatore", plugins: [ new Ext.ux.FieldHelp("Scegli un delimitatore per il file CSV") ], queryMode: 'local', store: JGrid.combo_store[2], valueField: "delimiter", displayField: "delimiter_description", id: "delimiter_combo", selectOnFocus: true, typeAhead: true, editable: true }); var combo3 = new Ext.form.ComboBox({ typeAhead: true, id:'grid_sheet_title', height: 32, emptyText: "SELECT_A_SHEET", triggerAction: 'query', lazyRender: true, forceSelection: true, valueNotFoundText: "SELECT_A_FIELD", fieldLabel: "SHEET_REF", plugins: [ new Ext.ux.FieldHelp("SELECT_A_SHEET_TO_ASSOCIATE_WITH_IMAGE_POPUP_BUTTON") ], queryMode: 'remote', store: JGrid.combo_store[3], valueField: 'grid_sheet_id', displayField: 'grid_sheet_title', selectOnFocus: true, typeAhead: true, editable: true, triggerAction: 'all' }); // combo boxs for security access for type role or user var combo40 = Ext.create('Ext.form.ComboBox', { typeAhead: true, emptyText: "SELECT_A_TYPE", lazyRender: true, forceSelection: true, valueNotFoundText: "VALUE_NOT_FOUND", fieldLabel: "ACCESS_FOR", plugins: [ new Ext.ux.FieldHelp("ACCESS_FOR_TOOLTIP") ], queryMode: 'local', store: JGrid.combo_store[40], valueField: 'access_for', displayField: 'Type', selectOnFocus: true, typeAhead: true, editable: true }); // hide selections when creator type combo40.on('select', function () { if(combo40.getValue() == "4") { combo44.setValue("4"); combo44.hide(); } else { combo44.show(); } combo411.clearValue(); }); var combo41 = Ext.create('Ext.form.ComboBox', { typeAhead: true, emptyText: "SELECT_A_TYPE", lazyRender: true, forceSelection: true, valueNotFoundText: "VALUE_NOT_FOUND", fieldLabel: "USER_ROLE_NAME", plugins: [ new Ext.ux.FieldHelp("USER_NAME_TOOLTIP") ], mode: 'local', store: JGrid.combo_store[41], valueField: 'rslvl_id', displayField: 'role_or_user', selectOnFocus: true, typeAhead: true, editable: true, triggerAction: 'all' }); combo41.on('expand', function () { var access_for = combo40.getValue(); if (access_for=="") { combo41.collapse(); window.alert("ACCESS_FOR_NOT_SELECTED", "PLEASE_SELECT_ACCESS_FOR"); return false; } JGrid.combo_store[41].load({ params: { access_for: access_for } }) }); var combo411 = Ext.create('Ext.form.ComboBox', { typeAhead: true, emptyText: "SELECT_A_TYPE", triggerAction: 'query', lazyRender: true, forceSelection: true, valueNotFoundText: "VALUE_NOT_FOUND", fieldLabel: "USER_ROLE_NAME", plugins: [ new Ext.ux.FieldHelp("USER_NAME_TOOLTIP") ], mode: 'local', store: JGrid.combo_store[411], valueField: 'access_for_id', displayField: 'access_for_name', selectOnFocus: true, typeAhead: true, editable: true, triggerAction: 'all' }); combo411.on('expand', function () { var access_for = combo40.getValue(); if (access_for=="") { combo411.collapse(); window.alert("ACCESS_FOR_NOT_SELECTED", "PLEASE_SELECT_ACCESS_FOR"); return false; } JGrid.combo_store[411].proxy.url = "index.php?option=com_jgrid&task=access_for_name_id&controller=jgrid_security&format=ajax&access_for="+access_for; JGrid.combo_store[411].load({ params: { access_for: access_for } }) }); var combo42 = new Ext.form.ComboBox({ typeAhead: true, emptyText: "SELECT_A_TYPE", triggerAction: "all", lazyRender: true, forceSelection: true, valueNotFoundText: "VALUE_NOT_FOUND", fieldLabel: "ACCESS_TYPE", plugins: [ new Ext.ux.FieldHelp("ACCESS_TYPE_TOOLTIPP") ], mode: "local", store: new Ext.data.SimpleStore({ id: 0, fields: [ {name: "access_type", type: "string"}, {name: "Type", type: "string"} ], data: [["3", "SHEET"], ["4", "SHEET_COLUMN"]]//comboData }), listeners: { select: { fn: function (combo, value) { JGrid.newcolumnrecord = value; combo431.clearValue(); } } }, valueField: "access_type", displayField: "Type"}); // hide selections when creator type combo42.on('select', function () { combo431.clearValue(); }); var combo43 = new Ext.form.ComboBox({ typeAhead: true, emptyText: "SELECT_A_TYPE", fieldLabel: "OBJECT_NAME", plugins: [ new Ext.ux.FieldHelp("OBJECT_NAME_TOOLTIPP") ], lazyRender: true, forceSelection: true, valueNotFoundText: "VALUE_NOT_FOUND", mode: 'local', store: JGrid.combo_store[43], valueField: 'access_type_id', displayField: 'access_type_name', selectOnFocus: true, typeAhead: true, editable: false, triggerAction: 'all' }); combo43.on('focus', function () { var access_type = combo42.getValue(); if (access_type=="") { combo43.collapse(); window.alert("ACCESS_TYPE_NOT_SELECTED", "PLEASE_SELECT_ACCESS_TYPE"); return false; } JGrid.combo_store[43].load({ params: { access_type: access_type, grid_application_name: JGrid.grid_application_name, grid_id: JGrid.gCurrentGridId } }); }); var combo431 = new Ext.form.ComboBox({ typeAhead: true, emptyText: "SELECT_A_TYPE", fieldLabel: "OBJECT_NAME", plugins: [ new Ext.ux.FieldHelp("OBJECT_NAME_TOOLTIPP") ], triggerAction: 'query', lazyRender: true, forceSelection: true, valueNotFoundText: "VALUE_NOT_FOUND", mode: 'local', store: JGrid.combo_store[431], valueField: 'access_type_id', displayField: 'access_type_name', selectOnFocus: true, width: 250, typeAhead: true, editable: false, triggerAction: 'all' }); combo431.on('focus', function () { var access_type = combo42.getValue(); if (access_type=="") { combo431.collapse(); window.alert("ACCESS_TYPE_NOT_SELECTED", "PLEASE_SELECT_ACCESS_TYPE"); return false; } JGrid.combo_store[431].proxy.url = "index.php?option=com_jgrid&task=access_type_name_id&controller=jgrid_security&format=ajax&access_type="+access_type; JGrid.combo_store[431].load({ params: { access_type: access_type, grid_application_name: JGrid.grid_application_name, grid_id: JGrid.gCurrentGridId } }); }); var combo44 = Ext.create("Ext.form.ComboBox", { typeAhead: true, emptyText: "SELECT_A_TYPE", fieldLabel: "ACCESS_LEVEL", plugins: [ new Ext.ux.FieldHelp("ACCESS_LEVEL_TOOLTIPP") ], triggerAction: "all", lazyRender: true, forceSelection: true, lastQuery: "", valueNotFoundText: "VALUE_NOT_FOUND", mode: "local", store: new Ext.data.SimpleStore({ id: 0, fields: [ {name: "access_level", type: "string"}, {name: "Type", type: "string"} ], data: [["0", "JNO_ACCESS"], ["1", "VIEWER"], ["-1", "VIEW_DOWNLOAD"], ["2", "CELL_EDIT"], ["3", "ROW_EDITOR"], ["4", "ADD_DELETE_ROWS"], ["-2", "CREATOR_RULE"], ["5", "SHEET_MANAGER"], ["6", "ACCESS_MANAGER"]] //comboData }), valueField: "access_level", displayField: "Type"} ); var combo50 = new Ext.form.ComboBox({ typeAhead: true, emptyText: "SELECT_A_TYPE", triggerAction: 'query', lazyRender: true, forceSelection: true, valueNotFoundText: "VALUE_NOT_FOUND", fieldLabel: "USER_ROLE_NAME", plugins: [ new Ext.ux.FieldHelp("USER_NAME_TOOLTIP") ], mode: 'local', store: JGrid.combo_store[50], valueField: 'rslvl_id', displayField: 'role_or_user', selectOnFocus: true, typeAhead: true, editable: true, triggerAction: 'all' }); Ext.define("JGrid.view.JGridImageWin", { extend : "Ext.window.Window", alias : "widget.JGridImageWin", id: "JGridImageWin", loadMask: true, closeAction: "hide", resizable: true, minimizable: true, style: { ZIndex:100000 }, width: JGrid.thumbnailImage["width"]+5, height: JGrid.thumbnailImage["height"]+5, maximizable: true, // listeners: { // 'resize': function () { // Ext.getCmp("image_win_id").setSize(Ext.getCmp("JGridImageWin").width, Ext.getCmp("JGridImageWin").height); // Ext.getCmp("JGridImageWin").updateLayout(); // } // }, renderTo: "jgrid_module6", title: "URL", items: [{ xtype: "uxiframe", id: "image_win_id", pinned:true, preserveRatio: true, fit: true, src: "", //width: JGrid.thumbnailImage["width"], height: "100%" }], buttons: [{ id: "go_to_url", text: "GO_TO_URL", handler: function(){ window.open(JGrid.thumbnailImage["hyper_url"], "image_window"); } }, { id: "go_to_email", text: "GO_TO_EMAIL", handler: function(){ show_email_window(); } }, { id: "go_to_sheet", text: "GO_TO_SHEET", handler: function(){ new_document_array = JGrid.thumbnailImage["hyper_grid_sheet"].split("-"); new_grid_id = "Grid-"+new_document_array[0]; new_grid_index = JGrid.crossGridIdRef[new_grid_id]; current_document_id_stack=JGrid.document_id_stack[new_grid_index]; new_document_id = new_document_array[1]; last_document_id = 0; grid_tabpanel = Ext.ComponentMgr.get("grid_tabpanel"); if (new_document_id==0||new_document_id==null) { current_document_id_stack.push(last_document_id); Ext.Msg.alert("GRID_SHEET_NOT_FOUND", "THIS_HYPER_LINK_IS_NOT_ACTIVE_PLEASE_CONTACT_YOUR_ADMINISTRATOR"); return; } else { grid_tabpanel.setActiveTab(new_grid_id); last_document_id = current_document_id_stack[current_document_id_stack.length - 1]; current_document_id_stack.push(new_document_id); } last_grid_id_stack.push(JGrid.thumbnailImage["grid_reference_id"]); Ext.ComponentMgr.get(new_grid_id).store.reload({ params: { new_document_id: new_document_id, last_document_id: last_document_id } }); Ext.ComponentMgr.get(cross_return_button_id_ref[new_grid_index]).show(); image_win.hide(); } } ,{ id: "download_button", text: "DOWNLOAD_IMAGE" , handler: function(){ window.open( "https://www.edili.com/index.php?option=com_jgrid&task=download_images&controller=jgrid_images&format=ajax&grid_id="+JGrid.thumbnailImage["grid_id"]+"&document_id="+JGrid.thumbnailImage["document_id"]+"&column_id="+JGrid.thumbnailImage["column_id"]+"&row_id="+JGrid.thumbnailImage["row_id"]+""); } } ]}); Ext.define("JGrid.view.JGridEmailWin", { extend : "Ext.window.Window", alias : "widget.JGridEmailWin", id: "JGridEmailWin", title: "", border: false, closeAction: "hide", layout: 'fit', autoHeight: true, renderTo: "jgrid_module6", width: 500,height: 275, items: [{ xtype: 'form', id: "JGridEmailFm", fileUpload: true, buttonAlign: "center", width: 590, //fit: true, frame: true, style: "margin: 0 auto;", title: "SEND_EMAIL_FORM", autoHeight: true, bodyStyle: "padding: 10px 10px 0 10px;", labelWidth: 60, defaults: { anchor: "95%", allowBlank: true, msgTarget: "side" }, items: [ { xtype: "textfield", fieldLabel: "EMAIL_TO", plugins: [ new Ext.ux.FieldHelp("EMAIL_TO_TOOLTIP") ], name: "email_to_address", width: 100, // disabled: true, vtype : 'email' }, { xtype: "textfield", fieldLabel: "EMAIL_FROM", plugins: [ new Ext.ux.FieldHelp("EMAIL_FROM_TOOLTIP") ], name: "email_from_address", width: 100, vtype : 'email' }, { xtype: "textfield", fieldLabel: "NAME_FROM", plugins: [ new Ext.ux.FieldHelp("EMAIL_FROM_TOOLTIP") ], name: "email_from_name", width: 100 }, { xtype: "textfield", fieldLabel: "EMAIL_SUBJECT", plugins: [ new Ext.ux.FieldHelp("EMAIL_SUBJECT_TOOLTIP") ], name : 'email_subject_name', width: 150, anchor : '95%' }, { fieldLabel: "EMAIL_MESSAGE", plugins: [ new Ext.ux.FieldHelp("EMAIL_MESSAGE_TOOLTIP") ], cls : 'x-plain', height : 300, name : 'email_message', layout : 'fit', xtype : 'htmleditor', anchor : '95%' }, { xtype: "fileuploadfield", id: "attachment_up_load", emptyText: "SELECT_A_FILE_TO_UPLOAD", fieldLabel: "ATTACHMENT", plugins: [ new Ext.ux.FieldHelp("SELECT_A_FILE_TO_UPLOAD") ], name: "data" } ], buttons: [{ text: "SEND", handler: function(){ if(JGrid.email_form.getForm().isValid()){ JGrid.email_form.getForm().submit({ url: "https://www.edili.com/index.php?option=com_jgrid&task=send_email&format=ajax", waitMsg: "SENDING_YOUR_EMAIL", timeout : 5, failure: function (email_form, options) { Ext.MessageBox.alert("SENDING_EMAIL_FAILED",Ext.decode(options.response.responseText).message); }, success: function(email_form, options){ if (!response.responseText.success) { Ext.MessageBox.alert("SENDING_EMAIL_FAILED",Ext.decode(options.response.responseText).message); } else { JGrid.email_win .hide(); } } }); } } }, { text: "RESET", handler: function(){ JGrid.email_form.getForm().reset(); } }] }] }); Ext.define("JGrid.view.JGridThumbnailWin", { extend : "Ext.window.Window", alias : "widget.JGridThumbnailWin", id: "JGridThumbnailWin", title: "", border: false, closeAction: "hide", layout: 'fit', autoHeight: true, renderTo: "jgrid_module6", width: 500,height: 325, items: [{ id: 'thumbtabs', xtype : "tabpanel", enableTabScroll:true, margins: "5 5 0 0", activeTab: 0, items : [{ xtype: 'form', extend : "Ext.form.Panel", alias : "widget.JGridThumbnailFm", id: "JGridThumbnailFm", fileUpload: true, isUpload: true, buttonAlign: 'center', // width: 400, frame: true, style: 'margin: 0 auto;', title: "FILE_UPLOAD_FORM", autoHeight: true, defaultType: "container", bodyStyle: "padding: 10px 10px 0 10px;", labelWidth: 50, defaults: { autoEl: {}, anchor: '100%', allowBlank: true, msgTarget: "side", layout: 'form' }, items: [{ xtype: 'fieldset', autoHeight: true, labelAlign: 'right', waitMsgTarget: true, defaultType: "container", items: [{ xtype: "filefield", buttonConfig: { iconCls: 'upload-icon' }, buttonText: 'browse', disabled: false, id: "photo", emptyText: "SELECT_AN_IMAGE", fieldLabel: "PHOTO", plugins: [ new Ext.ux.FieldHelp("SELECT_AN_IMAGE_TO_UPLOAD") ], name: "photo" }, { xtype: 'textfield', id: "imagetooltip", emptyText: "ENTER_A_TOOLTIP", fieldLabel: "TOOLTIP", plugins: [ new Ext.ux.FieldHelp("ENTER_A_TOOLTIP_TO_HOVER_OVER_THE_IMAGE_THUMBNAIL") ], name: 'imagetooltip', width: 300 }, { xtype: 'textfield', id: "image_url", emptyText: "ENTER_A_URL", fieldLabel: "URL_REF", plugins: [ new Ext.ux.FieldHelp("ENTER_A_URL_TO_ASSOCIATE_WITH_IMAGE_POPUP_BUTTON") ], name: 'image_url', vtype: 'url', width: 300 }, combo3, { xtype: 'textfield', id: "image_email", emptyText: "ENTER_AN_EMAIL", fieldLabel: "EMAIL_REF", plugins: [ new Ext.ux.FieldHelp("ENTER_AN_EMAIL_TO_ASSOCIATE_WITH_IMAGE_POPUP_BUTTON") ], name: 'image_email', vtype: 'email', width: 300 }, { xtype: 'textfield', id: "image_email_subject", emptyText: "ENTER_EMAIL_SUBJECT", fieldLabel: "EMAIL_SUBJECT_REF", plugins: [ new Ext.ux.FieldHelp("ENTER_THE_DEFAULT_SUBJECT_OF_EMAIL") ], name: 'image_email_subject', width: 300 }] } ], buttons: [{ text: "SAVE", handler: function(){ if(Ext.getCmp("JGridThumbnailFm").getForm().isValid()){ Ext.getCmp("JGridThumbnailFm").getForm().submit({ url: "https://www.edili.com/index.php?option=com_jgrid&task=save_images&controller=jgrid_images&format=ajax&loadtype=image&grid_sheet="+combo3.getValue()+"&filename="+Ext.getCmp("photo").getValue()+"&tooltip="+Ext.getCmp("imagetooltip").getValue()+"&grid_id="+JGrid.thumbnailImage["grid_id"]+"&document_id="+JGrid.thumbnailImage["document_id"]+"&column_id="+JGrid.thumbnailImage["column_id"]+"&row_id="+JGrid.thumbnailImage["row_id"]+"&primary_key_value="+JGrid.thumbnailImage["primary_key_value"]+"", waitMsg: "UPLOADING_YOUR_PHOTO", failure: function (response, o) { Ext.MessageBox.alert("IMAGE_SAVE_FAILED",Ext.decode(o.response.responseText).data); }, success: function(jgrid_thumbnail_loader, o){ var revisedData = Ext.decode(o.response.responseText).data; JGrid.cacheState[JGrid.thumbnailImage["grid_index"]][JGrid.thumbnailImage["column_index"]]++; JGrid.thumbnailImage["record"].set(JGrid.thumbnailImage["fieldName"],revisedData); // Ext.ComponentMgr.get("photo").setValue(""); JGrid.thumbnail_win.hide(); } }); } } }, { text: "DELETE", handler: function(){ Ext.Ajax.request({ waitMsg: "DELETING_IMAGE", url: "https://www.edili.com/index.php?option=com_jgrid&task=update&delete_image=1&grid_id="+JGrid.thumbnailImage["grid_id"]+"&document_id="+JGrid.thumbnailImage["document_id"]+"&column_id="+JGrid.thumbnailImage["column_id"]+"&row_id="+JGrid.thumbnailImage["row_id"]+"&format=ajax", params: { rows: '{"'+JGrid.thumbnailImage["fieldName"]+'":"","id":'+JGrid.thumbnailImage["record"].id+'}' }, method: "POST", failure: function (response, options) { Ext.MessageBox.alert("IMAGE_DELETE_FAILED", ""); }, success: function (response, options) { var server_response = Ext.decode(response.responseText); if (!server_response.success) { Ext.MessageBox.alert("IMAGE_DELETE_FAILED", ""); } else { // delete from screen JGrid.thumbnailImage["record"].set(JGrid.thumbnailImage["fieldName"],""); Ext.getCmp("JGridThumbnailFm").getForm().reset(); JGrid.thumbnail_win.hide(); } }, scope: this }); } }, { text: "RESET", handler: function(){ Ext.getCmp("JGridThumbnailFm").getForm().reset(); } }] }, { xtype: 'form', extend : "Ext.form.Panel", alias : "widget.JGridOptThumbFm", id: "JGridOptThumbFm", fileUpload: true, isUpload: true, hidden: true, buttonAlign: 'center', width: 400, frame: true, style: 'margin: 0 auto;', title: "OPTIONAL_CUSTOM_THUMBNAIL_IMAGE", autoHeight: true, bodyStyle: "padding: 10px 10px 0 10px;", labelWidth: 50, defaults: { anchor: "95%", allowBlank: true, msgTarget: "side" }, items: [{ xtype: "filefield", buttonConfig: { iconCls: 'upload-icon' }, buttonText: 'browse', disabled: false, id: "thumbnail_image", emptyText: "SELECT_AN_THUMBNAIL_IMAGE", fieldLabel: "THUMBNAIL_IMAGE", plugins: [ new Ext.ux.FieldHelp("SELECT_A_THUMBNAIL_IMAGE_TO_UPLOAD") ], name: "thumbnail_image" } ], buttons: [{ text: "SAVE", handler: function(){ if(Ext.getCmp("JGridOptThumbFm").getForm().isValid()){ Ext.getCmp("JGridOptThumbFm").getForm().submit({ url: "https://www.edili.com/index.php?option=com_jgrid&task=save_images&controller=jgrid_images&format=ajax&loadtype=thumb&grid_sheet="+JGrid.thumbnail_loader.items.items[3].getValue()+"&filename="+JGrid.thumbnail_loader.items.items[0].getValue()+"&tooltip="+JGrid.thumbnail_loader.items.items[1].getValue()+"&grid_id="+JGrid.thumbnailImage["grid_id"]+"&document_id="+JGrid.thumbnailImage["document_id"]+"&column_id="+JGrid.thumbnailImage["column_id"]+"&row_id="+JGrid.thumbnailImage["row_id"]+"", waitMsg: "UPLOADING_YOUR_IMAGE", failure: function (response, o) { Ext.MessageBox.alert("IMAGE_SAVE_FAILED",Ext.decode(o.response.responseText).data); }, success: function(jgrid_thumbnail_loader, o){ var revisedData = Ext.decode(o.response.responseText).data; JGrid.cacheState[JGrid.thumbnailImage["grid_index"]][JGrid.thumbnailImage["column_index"]]++; JGrid.thumbnailImage["record"].set(JGrid.thumbnailImage["fieldName"],revisedData); // Ext.ComponentMgr.get("photo").setValue(""); JGrid.thumbnail_win.hide(); } }); } } }, { text: "DELETE", handler: function(){ Ext.Ajax.request({ waitMsg: "DELETING_IMAGE", url: "https://www.edili.com/index.php?option=com_jgrid&task=delete_images&controller=jgrid_images&format=ajax&delete_image=1&grid_id="+JGrid.thumbnailImage["grid_id"]+"&document_id="+JGrid.thumbnailImage["document_id"]+"&column_id="+JGrid.thumbnailImage["column_id"]+"&row_id="+JGrid.thumbnailImage["row_id"]+"&format=ajax", params: { rows: '{"'+JGrid.thumbnailImage["fieldName"]+'":"","id":'+JGrid.thumbnailImage["record"].id+'}' }, method: "POST", failure: function (response, options) { Ext.MessageBox.alert("IMAGE_DELETE_FAILED", ""); }, success: function (response, options) { var server_response = Ext.decode(response.responseText); if (!server_response.success) { Ext.MessageBox.alert("IMAGE_DELETE_FAILED", ""); } else { // delete from screen Ext.getCmp("JGridOptThumbFm").getForm().reset(); JGrid.thumbnail_win.hide(); } }, scope: this }); } }, { text: "RESET", handler: function(){ Ext.getCmp("JGridOptThumbFm").getForm().reset(); } }] }] }] }); Ext.define("JGrid.view.JGridDownloadWin", { extend : "Ext.window.Window", alias : "widget.JGridDownloadWin", id: "JGridDownloadWin", title: "", border: false, closeAction: "hide", layout: 'fit', autoHeight: true, renderTo: "jgrid_module6", width: 500,height: 200, items: [{ xtype: 'form', id: "JGridDownloadFm", buttonAlign: "center", width: 450, frame: true, style: "margin: 0 auto;", title: "SCARICAMENTO", autoHeight: true, bodyStyle: "padding: 10px 10px 0 10px;", labelWidth: 60, defaults: { autoEl: {}, anchor: '100%', allowBlank: true, msgTarget: "side", layout: 'form' }, items: [{ xtype: 'fieldset', autoHeight: true, labelAlign: 'right', waitMsgTarget: true, defaultType: "container", items: [ { xtype: "textfield", fieldLabel: "Nome file", plugins: [ new Ext.ux.FieldHelp("Inserire il nome con cui verrà scaricato il file") ], name: "download_file_name", width: 100 }, combo2 ] }], buttons: [{ text: "SALVA", handler: function(){ testValues = JGrid.data_downloader.getValues(); var download_file_name = JGrid.data_downloader.getForm().findField("download_file_name").getValue();; var delimiter_combo = JGrid.data_downloader.getForm().findField("delimiter_combo").getValue(); var grid_id = JGrid.csvDownload["grid_id"]; var document_id = JGrid.csvDownload["document_id"]; urlValue = "https://www.edili.com/index.php?option=com_jgrid&task=read&format=ajax&download_csv_document=1&filename="+download_file_name+"&delimiter="+delimiter_combo+"&grid_id="+grid_id+"&document_id="+document_id+""; window.open(urlValue); JGrid.download_win.hide(); } }, { text: "RESET", handler: function(){ JGrid.data_downloader.getForm().reset(); } }] }] }); Ext.define("JGrid.view.JGridUploadWin", { extend : "Ext.window.Window", alias : "widget.JGridUploadWin", id: "JGridUploadWin", title: "", border: false, closeAction: "hide", layout: 'fit', autoHeight: true, renderTo: "jgrid_module6", width: 500,height: 200, items: [{ xtype: 'form', id: "JGridUploadFm", fileUpload: true, buttonAlign: "center", width: 450, frame: true, style: "margin: 0 auto;", title: "FILE_UPLOAD_FORM", autoHeight: true, bodyStyle: "padding: 10px 10px 0 10px;", labelWidth: 60, defaults: { autoEl: {}, anchor: '100%', allowBlank: true, msgTarget: "side", layout: 'form' }, items: [{ xtype: 'fieldset', autoHeight: true, labelAlign: 'right', waitMsgTarget: true, defaultType: "container", items: [ { xtype: "fileuploadfield", id: "data_up_load", emptyText: "SELECT_A_FILE_TO_UPLOAD", fieldLabel: "PHOTO", plugins: [ new Ext.ux.FieldHelp("SELECT_A_FILE_TO_UPLOAD") ], name: "data" }, combo1 ] }], buttons: [{ text: "SAVE", handler: function(){ if(JGrid.data_loader.getForm().isValid()){ var data_up_load = JGrid.data_loader.getForm().findField("data_up_load").getValue(); var delimiter_comboo = JGrid.data_loader.getForm().findField("delimiter_comboo").getValue(); JGrid.data_loader.getForm().submit({ url: "https://www.edili.com/index.php?option=com_jgrid&controller=jgrid_csv&task=save_csv&format=ajax&filename="+data_up_load+"&delimiter="+delimiter_comboo+"&grid_id="+JGrid.csvUpload["grid_id"]+"&sel_row_id="+JGrid.csvUpload["sel_row_id"]+"&row_insert_position="+JGrid.csvUpload["row_insert_position"]+"", waitMsg: "UPLOADING_YOUR_DATA", failure: function (response, o) { Ext.MessageBox.alert("DATA_UPLOAD_FAILED",Ext.decode(o.response.responseText).data); }, success: function(jgrid_thumbnail_loader, o){ var revisedData = Ext.decode(o.response.responseText).data; JGrid.store[JGrid.csvUpload["index"]].load(); //grid refresh JGrid.upload_win.hide(); } }); } } }, { text: "UNDO_LAST_UPLOAD", handler: function(){ Ext.Ajax.request({ waitMsg: "DELETING_IMAGE", url: "https://www.edili.com/index.php?option=com_jgrid&controller=jgrid_csv&task=undo_last_csv_upload&grid_id="+JGrid.csvUpload["grid_id"]+"&format=ajax", method: "POST", failure: function (response, options) { Ext.MessageBox.alert("UPLOAD_DATA_DELETE_FAILED", ""); }, success: function (response, options) { var server_response = Ext.decode(response.responseText); if (!server_response.success) { Ext.MessageBox.alert("IMAGE_DELETE_FAILED", ""); } else { // delete from screen JGrid.store[JGrid.csvUpload["index"]].load(); JGrid.upload_win.hide(); } }, scope: this }); } }, { text: "RESET", handler: function(){ JGrid.data_loader.getForm().reset(); } }] }] }); JGrid.cacheState[0]=new Array();demodata0=false;demodata0=false;demodata0=false;demodata0=false;demodata0=false;demodata0=false;demodata0=false;demodata0=false;demodata0=false;demodata0=false;demodata0=false; var access_level_array0 = "";JGrid.editMode[0] = false;JGrid.primary_key_column[0] = "";JGrid.row_edit_enabled[0]=true;JGrid.editor[0] = Ext.create("Ext.grid.plugin.RowEditing", { saveText: "Update", errorSummary: false, listeners: { beforeedit: function(thisEditor,rowdata) { if(JGrid.editMode[0]==false) { JGrid.editor[0].cancelEdit(); return(false); } var grid = Ext.ComponentMgr.get("Grid-20"); var grid_columns = grid.columns; editor_columns = this.editor.query("textfield"); var editable_line = rowdata.record.get("editable_line"); var id = rowdata.record.get("id"); // if(id == 0) // { // thisEditor.cancelEdit(); // return (false); // } if(access_level_array0[0]=="6") { //grid_columns[JGrid.columnCount[0]+5].show(); editor_columns[editor_columns.length-1].setDisabled(false); //thisEditor.query("textfield")[thisEditor.query("textfield").length-1].setDisabled(false); } else { //grid_columns[JGrid.columnCount[0]+5].hide(); if(editable_line!=true) { thisEditor.cancelEdit(); return(false); } } // If sheet access level is view only as default look for columns and rows that are editable to shit user // if no edit button and no access array cancle if(!access_level_array0) { thisEditor.cancelEdit(); return(false); } // hide editable column from editor rms problem // grid_columns[JGrid.columnCount[0]+2].hide(); // cell and column rule edit if(access_level_array0[0]<"3") { // current_grid.editingPlugin.editor.query("textfield")[i].setDisabled(true); // look for columns that are "cell edit" for(var i=1;i'+ value +''; }},{ id: "T119", header: "Email", dataIndex:"T119", defaultWidth: 150, draggable: true, width: 150, tooltip: "",sortable: true,xtype: "gridcolumn",renderer: function (value){ return '
'+ value +'
'; }},{ id: "T120", header: "Codice fiscale", dataIndex:"T120", defaultWidth: 100, draggable: true, width: 100, tooltip: "",sortable: true,xtype: "gridcolumn",renderer: function (value){ return '
'+ value +'
'; }},{ id: "T121", header: "Codice corso", dataIndex:"T121", defaultWidth: 100, draggable: true, width: 100, tooltip: "",sortable: true,xtype: "gridcolumn",renderer: function (value){ return '
'+ value +'
'; }},{ id: "I198", header: "Posti Preiscrizioni", dataIndex:"I198", defaultWidth: 50, draggable: true, width: 50, tooltip: "",sortable: true,summaryType:"sum",summaryRenderer: function(value){ return Ext.String.format(" {0} ", value, value !== 1 ? "s" : ""); },xtype: "numbercolumn"},{ id: "T122", header: "Nome corso", dataIndex:"T122", defaultWidth: 200, draggable: true, width: 200, tooltip: "",sortable: true,xtype: "gridcolumn",renderer: function (value){ return '
'+ value +'
'; }},{ id: "T124", header: "Data preiscrizione", dataIndex:"T124", defaultWidth: 100, draggable: true, width: 100, tooltip: "",sortable: true,xtype: "gridcolumn",renderer: function (value){ return '
'+ value +'
'; }},{ id: "T153", header: "Telefono", dataIndex:"T153", defaultWidth: 100, draggable: true, width: 100, tooltip: "",sortable: true,xtype: "gridcolumn",renderer: function (value){ return '
'+ value +'
'; }},{ id: "T154", header: "Telefono", dataIndex:"T154", defaultWidth: 100, draggable: true, width: 100, tooltip: "",sortable: true,xtype: "gridcolumn",renderer: function (value){ return '
'+ value +'
'; }},{ id: "U135", header: "Doppio click per modifica", dataIndex:"U135", defaultWidth: 150, draggable: true, width: 150, tooltip: "",xtype: "gridcolumn" ,renderer: function(value){ return "" + value + "" },renderer: function (value){ var index =value.indexOf("^"); // add ^ url data to url string not visible in cell after ^ if(index != -1) { value = value.substr(0, index); } return '
'+ value +'
'; }},{ id: "U155", header: "Doppio click per elimina", dataIndex:"U155", defaultWidth: 150, draggable: true, width: 150, tooltip: "",xtype: "gridcolumn" ,renderer: function(value){ return "" + value + "" },renderer: function (value){ var index =value.indexOf("^"); // add ^ url data to url string not visible in cell after ^ if(index != -1) { value = value.substr(0, index); } return '
'+ value +'
'; }} ,{id: "editable_line0", header: "EDITABLE", xtype: "booleancolumn", align: "center",trueText: "\"Editable\"", dataIndex: "editable_line", hidden: true} ,{id: "slvl0", header: "Access Level", dataIndex: "slvl", hidden: true} ,{id: "row_color0", header: "Row Color", dataIndex: "row_color", hidden: true} ,{ id: "rslvl_id0", header: "EDIT_USER_ROLE", dataIndex: "rslvl_id", renderer: function (value) { var r = JGrid.combo_store[50].findRecord("rslvl_id", value); if (Ext.isEmpty(r)) { return "VALUE_NOT_FOUND"; } return r.data.role_or_user; }, tooltip: "EDIT_USER_ROLE_TOOLTIP", editor: JGrid.rslvlCombo[0], hidden: true } ];JGrid.columnCount[0]=10;JGrid.columns_access = [{ header: "ID", dataIndex: "id", hidden: false, tooltip: "ACCESS_RULE_ID_TOOLTIP", allowBlank: true }, { header: "ACCESS_FOR", dataIndex: "access_for", renderer: function (value) { var r = JGrid.combo_store[40].findRecord("access_for", value) if (Ext.isEmpty(r)) { return "VALUE_NOT_FOUND"; } return r.data.Type; }, tooltip: "ACCESS_FOR_TOOLTIP" }, { header: "USER_ROLE_NAME", dataIndex: "access_for_id", renderer: function (value) { var r = JGrid.combo_store[41].findRecord("access_for_id", value) if (Ext.isEmpty(r)) { return "VALUE_NOT_FOUND"; } return r.data.access_for_name; }, tooltip: "USER_NAME_TOOLTIP" }, { header: "ACCESS_TYPE", dataIndex: "access_type", renderer: function (value) { var r = JGrid.combo_store[42].findRecord("access_type", value) if (Ext.isEmpty(r)) { return "VALUE_NOT_FOUND"; } return r.data.Type; }, tooltip: "ACCESS_TYPE_TOOLTIP" }, { header: "OBJECT_NAME", dataIndex: "access_type_id", renderer: function (value) { var r = JGrid.combo_store[43].findRecord("access_type_id", value) if (Ext.isEmpty(r)) { return "VALUE_NOT_FOUND"; } return r.data.access_type_name; }, tooltip: "OBJECT_NAME_TOOLTIP", width: 200 }, { header: "ACCESS_LEVEL", dataIndex: "access_level", renderer: function (value) { var r = JGrid.combo_store[44].findRecord("access_level", value) if (Ext.isEmpty(r)) { return "VALUE_NOT_FOUND"; } return r.data.Type; }, tooltip: "ACCESS_LEVEL_TOOLTIP" }, { header: "USERID_ASSIGNING_ACCESS", dataIndex: "userid_assigning_access", tooltip: "USERID_ASSIGNING_ACCESS_TOOLTIP", hidden: true }, { header: "LAST_UPDATED", dataIndex: "last_updated", tooltip: "LAST_UPDATED_TOOLTIP", hidden: true }]; Ext.define("JGrid.view.JGridToolbarSecurity", { extend : "Ext.toolbar.Toolbar", //requires : [ "JGrid.view.JGridHelpAccess"], alias : "widget.JGridToolbarSecurity", id : "JGridToolbarSecurity", items : [{ text: "ADD_ACCESS_RULE", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_add.png", cls: "x-btn-text-icon", tooltip: "ADD_ACCESS_RULE_TOOLTIP", handler: add_access_menu }, { text: "EDIT_ACCESS_RULE", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_add.png", cls: "x-btn-text-icon", tooltip: "EDIT_ACCESS_RULE_TOOLTIP", handler: edit_access_menu }, { text: "DELETE_ACCESS_RULE", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_delete.png", cls: "x-btn-text-icon", tooltip: "DELETE_ACCESS_RULE_TOOLTIP", handler: function () { JGrid.currenteditgrid = JGrid.JGridSecurity; var sm = JGrid.currenteditgrid.getSelectionModel(); var sel = sm.getSelection(); if (sm.hasSelection()) { Ext.Msg.show({ title: "REMOVE_ACCESS_RULE", buttons: Ext.MessageBox.YESNOCANCEL, msg: "REMOVE_RULE", fn: function (btn) { if (btn == "yes") { JGrid.store_access.remove(sel[0]); } } }) } } }, { id: "user_help_access", text: "HELP", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/help.png", tooltip: "INSTRUCTIONS_DESCRIBING_GRID_OPERATION_TOOLTIP", handler: function () { if(!JGrid.HelpAccess) { JGrid.HelpAccess = Ext.create("JGrid.view.JGridHelpAccess"); } JGrid.HelpAccess.show(); } }] }); Ext.define("JGrid.view.JGridAccessRules", { extend : "Ext.window.Window", alias : "widget.JGridAccessRules", id: "JGridAccessRules", //RMS add language title: 'Create or Edit Access Rules', closable: true, closeAction: 'hide', layout: 'fit', autoHeight: true, renderTo: "jgrid_module6", width: 885,height: 430,x: 10,y: 130, plain: true, items: [ { xtype: 'form', id: "formpanel3", frame: true, labelWidth: 85, height: 430-30, layout: 'fit', items: [ { xtype: 'fieldset', autoHeight: true, labelAlign: 'right', waitMsgTarget: true, layout: 'column', defaultType: "container", listeners: { afterlayout: function(form, layout, eOpts) { // hide selections when creator type if(combo40.getValue() == "4") { combo44.setValue("1"); combo44.hide(); } else { combo44.show(); } } }, defaults: { autoEl: {}, layout: 'form', // applied to each contained item // width: 230, msgTarget: "side" }, items: [ { //title: 'Width = 50%', columnWidth: .5, items: [ new Ext.form.FieldSet({ // title: 'Contact Information', defaultType: 'textfield', defaults: { height: 30 }, autoHeight: true, items: [ { fieldLabel: "RULE_ID", plugins: [ new Ext.ux.FieldHelp("RULE_ID_TOOLTIP") ], name: 'id', id: 'access_rule_id', disabled: true, width: "50px" }, combo40, combo411, combo42, combo431 ] }) ] }, { columnWidth: .5, items: [ new Ext.form.FieldSet({ // title: 'Contact Information', defaultType: 'textfield', autoHeight: true, defaults: { height: 30 }, items: [combo44] }) ] } ] }], buttons: [{ text: "SAVE_CHANGES", tooltip: "SAVE_CHANGES_TOOLTIP", disabled: false, handler: function () { if(combo40.getValue()==""||Ext.isEmpty(combo40.getValue())) { window.alert("PLEASE_SELECT_ACCESS_FOR_VALUE"); return; } if(combo411.getValue()==""||Ext.isEmpty(combo411.getValue())) { window.alert("PLEASE_SELECT_USER_ROLE_NAME_VALUE"); return; } if(combo42.getValue()==""||Ext.isEmpty(combo42.getValue())) { window.alert("PLEASE_SELECT_ACCESS_TYPE_VALUE"); return; } if(combo431.getValue()==""||Ext.isEmpty(combo431.getValue())) { window.alert("PLEASE_SELECT_OBJECT_NAME_VALUE"); return; } if(combo44.getValue()==""||Ext.isEmpty(combo44.getValue())) { window.alert("PLEASE_SELECT_ACCESS_LEVEL_VALUE"); return; } // update combo boxs record_index = JGrid.combo_store[431].find('access_type_id', combo431.getValue(),0,true,false) record = JGrid.combo_store[431].getAt(record_index); // set new value and display of combo var col431 = { access_type_name: record.get("access_type_name"), access_type_id: combo431.getValue() }; JGrid.combo_store[431].insert(1,col431); record_index = JGrid.combo_store[411].find('access_for_id', combo411.getValue(),0,true,false) record = JGrid.combo_store[411].getAt(record_index); // set new value and display of combo var col411 = { access_for_name: record.get("access_for_name"), access_for_id: combo411.getValue() }; JGrid.combo_store[411].insert(1,col411); if (JGrid.selectedgridid) { // update record // update record if (record = JGrid.store[4].findRecord("id", JGrid.selectedgridid)) { JGrid.store[4].suspendEvents(true); record.set("access_for", combo40.getValue()); record.set("access_for_id", combo411.getValue()); record.set("access_type", combo42.getValue()); record.set("access_type_id", combo431.getValue()); record.set("access_level", combo44.getValue()); JGrid.store[4].resumeEvents(); } } // add record else { var jgrid_newrowcolumns4 = { userid_assigning_access: "", access_for: combo40.getValue(), access_for_name: combo40.lastSelection[0].data.Type, access_for_id: combo411.getValue(), access_type: combo42.getValue(), access_type_id: combo431.getValue(), access_type_name: col431.access_type_name, access_level: combo44.getValue(), last_updated: "" }; JGrid.store_access.add(jgrid_newrowcolumns4); JGrid.currenteditgrid = JGrid.JGridSecurity; } } }, { text: "CLEAR_FORM", tooltip: "CLEAR_FORM_DATA", disabled: false, handler: function(){ Ext.ComponentMgr.get("formpanel3").getForm().setValues({ 'access_rule_id': '99999' }); combo40.clearValue(); combo411.clearValue(); combo42.clearValue(); combo431.clearValue(); combo44.clearValue(); JGrid.selectedgridid=0; } }] }] }); Ext.define("JGrid.view.Security", { extend : "Ext.window.Window", alias : "widget.Security", requires : [ "JGrid.view.JGridToolbarSecurity"], id: "Security", closeAction: "hide", tbar: {xtype: "JGridToolbarSecurity"}, frame: true, stripeRows: true, enableColumnResize: true, columnLines: true, layout: "fit", autoHeight: true,renderTo: "jgrid_module6", width: 725,height: 500,plain: true, items: [ { xtype: "grid", id: "jgrid_security", layout: "fit", autoHeight: true, title: "MANAGE_USER_ACCESS", tabTip: "MANAGE_USER_ACCESS_TABTIP", beforeRender: function() { JGrid.JGridSecurity = Ext.ComponentMgr.get("jgrid_security"); }, store: JGrid.store_access, columns: JGrid.columns_access }] }); Ext.require(['Ext.data.*']); Ext.define('Writer.chartSeries', { extend: 'Ext.data.Model', fields: [ {name: 'series_type',type: 'string'}, {name:'series_axis',type: 'string'}, {name:'series_xaxis',type: 'string'}, {name:'series_yaxis',type: 'string'}, {name:'stacked_opt',type:'boolean'}, {name:'highlight',type:'boolean'} ] }); // The data store containing the list of axis //Creating dynamic array var arrField=[]; var series_gridStore =Ext.create('Ext.data.Store', { fields: [{name:'series_id',type: 'int'}, {name:'series_type',type: 'string'}, {name:'series_axis',type: 'string'}, {name:'series_xaxis',type: 'string'}, {name:'series_yaxis',type: 'string'}, {name:'stacked_opt',type:'boolean'}, {name:'highlight',type:'boolean'}] }); for(var i=1;i < JGrid.columns[0].length;i++) { if((JGrid.columns[0][i].dataIndex).substr(0,1)!="I" || JGrid.columns[0][i].dataIndex.substr(0,1)!="F" ) continue; var obj={ 'dataIndexVal':JGrid.columns[0][i].dataIndex, 'text':JGrid.columns[0][i].header } arrField.push(obj); } var stackedCb =Ext.create('Ext.data.Store', {fields: [{name:'stackedId',type: 'boolean'}, {name:'stackedVal'}], data:[{"stackedId":true, "stackedVal":"TTRUE"}, {" stackedId":false, "stackedVal":"FFALSE"}] }); var highlightCb =Ext.create('Ext.data.Store', { fields: [{name:'highlightId',type: 'boolean'}, {name:'highlightVal'}], data : [ {"highlightId":true, "highlightVal":"TTRUE"}, {"highlightId":false, "highlightVal":"FFALSE"} ] }); var states = Ext.create('Ext.data.Store', { fields: [{name:'type'},{name:'type_name'}], data :[ {"type":"bar", "type_name":"BAR_CHART"}, {"type":"column", "type_name":"COLUMN_CHART"}, {"type":"line", "type_name":"LINE_CHART"}, {"type":"area", "type_name":"AREA_CHART"}, {"type":"scatter", "type_name":"SCATTER_CHART"}, {"type":"pie", "type_name":"PIE_CHART"}, {"type":"radar", "type_name":"RADAR_CHART"} ] }); var series_chart_type = Ext.create('Ext.data.Store', { fields: [{name:'type'},{name:'type_name'}], data :[ {"type":"bar", "type_name":"BAR_CHART"}, {"type":"column", "type_name":"COLUMN_CHART"}, {"type":"line", "type_name":"LINE_CHART"}, {"type":"area", "type_name":"AREA_CHART"}, {"type":"scatter", "type_name":"SCATTER_CHART"}, {"type":"pie", "type_name":"PIE_CHART"}, {"type":"radar", "type_name":"RADAR_CHART"} ] }); /**Numeric Category Fields store **/ var numFieldCb = Ext.create('Ext.data.Store', { id:'numFieldCbId', autoLoad: false, fields: ['dataIndexVal', 'text'] }); /* *Category Fields Store */ var catFieldCb = Ext.create('Ext.data.Store', { id:'catFieldCbId', autoLoad: false, fields: ['dataIndexVal', 'text'] }); var naxesCb = Ext.create('Ext.data.Store', { id:'naxesCb', fields: ['pid', 'pval'], data :[ {"pid":"bottom", "pval":"BOTTOM"}, {"pid":"top", "pval":"TOP"}, {"pid":"left", "pval":"LEFT"}, {"pid":"right", "pval":"RIGHT"} ] }); var legendCb = Ext.create('Ext.data.Store', { id:'legendCb', fields: ['legendid','legendVal'], data :[ {"legendid":"bottom", "legendVal":"BOTTOM"}, {"legendid":"top", "legendVal":"TOP"}, {"legendid":"left", "legendVal":"LEFT"}, {"legendid":"right", "legendVal":"RIGHT"}, {"legendid":"relative","legendVal":"RELATIVE"}, {"legendid":"hidden","legendVal":"HIDDEN"} ] }); var chartCategoryCb = Ext.create('Ext.data.Store', { id:'naxesCb', fields: ['chart_cat', 'chart_catVal'], data :[ {"chart_cat":"cartesian", "chart_catVal":"CARTESIAN"}, {"chart_cat":"pie", "chart_catVal":"PIE"}, {"chart_cat":"radar", "chart_catVal":"RADAR"} ] }); var catPosStore = Ext.create('Ext.data.Store', { id:'catPosStore', fields:['cat_pid', 'cat_pval'], data :[ {"cat_pid":"bottom", "cat_pval":"BOTTOM"}, {"cat_pid":"top", "cat_pval":"TOP"}, {"cat_pid":"left", "cat_pval":"LEFT"}, {"cat_pid":"right", "cat_pval":"RIGHT"} ] }); var catLableStore = Ext.create('Ext.data.Store', { id:'catLableStoreId', fields:['cat_ldgree', 'cat_ldgreeVal'], data :[ {"cat_ldgree":45, "cat_ldgreeVal":"45"}, {"cat_ldgree":90, "cat_ldgreeVal":"90"}, {"cat_ldgree":135, "cat_ldgreeVal":"135"}, {"cat_ldgree":180, "cat_ldgreeVal":"180"}, {"cat_ldgree":225, "cat_ldgreeVal":"225"}, {"cat_ldgree":270, "cat_ldgreeVal":"270"}, {"cat_ldgree":315, "cat_ldgreeVal":"315"}, {"cat_ldgree":360, "cat_ldgreeVal":"360"} ] }); Ext.define("JGrid.view.JGridSheetSettingWin", { extend:"Ext.window.Window", alias:"widget.JGridSheetSettingWin", renderTo: "jgrid_module6", width:950,height: 600,height:650,y: 30, id: "JGridSheetSettingWinId", config:{ selectedId:null, grid_reference_id:null, documentIdStack:null, array_index:null, task:null, selectedSheetId:null }, constructor:function(config){ this.callParent(arguments); this.initConfig(config); }, listeners: { close:function(obj,opt){ obj.destroy(); }, afterrender:function(obj,opt){ var arrField=[]; var tbl_gridId=parseInt(obj.selectedId); var gridIndex=parseInt(obj.array_index); numFieldCb.removeAll(); catFieldCb.removeAll(); var configTask=obj.task; var configSelectedSheetId=obj.selectedSheetId; for(var i=1; i < JGrid.columns[gridIndex].length; i++){ // Adding record in Numeric axes if((JGrid.columns[gridIndex][i].dataIndex).substr(0,1)=="I"){ var obj={ 'dataIndexVal':JGrid.columns[gridIndex][i].dataIndex, 'text':JGrid.columns[gridIndex][i].header } numFieldCb.add(obj); //Only Adding default first Item if(Ext.isEmpty(Ext.getCmp('nFieldId').getValue())){ Ext.getCmp('nFieldId').setValue(JGrid.columns[gridIndex][i].dataIndex); } } if((JGrid.columns[gridIndex][i].dataIndex).substr(0,1)=="F"){ var obj={ 'dataIndexVal':JGrid.columns[gridIndex][i].dataIndex, 'text':JGrid.columns[gridIndex][i].header } numFieldCb.add(obj); //Only Adding First item as a default if(Ext.isEmpty(Ext.getCmp('nFieldId').getValue())){ Ext.getCmp('nFieldId').setValue(JGrid.columns[gridIndex][i].dataIndex); } } if((JGrid.columns[gridIndex][i].dataIndex).substr(0,1)=="T" || (JGrid.columns[gridIndex][i].dataIndex).substr(0,1)=="L"){ var obj={ 'dataIndexVal':JGrid.columns[gridIndex][i].dataIndex, 'text':JGrid.columns[gridIndex][i].header } catFieldCb.add(obj); if(Ext.isEmpty(Ext.getCmp('catField').getValue())){ Ext.getCmp('catField').setValue(JGrid.columns[gridIndex][i].dataIndex); } } } var mydata1 = []; var tempDefault=new Array(); tempDefault.push(1); tempDefault.push("column"); tempDefault.push("left"); tempDefault.push(Ext.getCmp('catField').getValue()); tempDefault.push(Ext.getCmp('nFieldId').getValue()); tempDefault.push(true); tempDefault.push(true); mydata1.push(tempDefault); series_gridStore.removeAll(); series_gridStore.loadData(mydata1, false); if(configTask=="Edit"){ //Edit Option Ext.getCmp('sheettype_chart_rd').setValue(true); Ext.getCmp('chartConfigId').setVisible(true); Ext.Ajax.request({ waitMsg: "CREATING_SHEET",url: "https://www.edili.com/index.php?option=com_jgrid&task=read_chart_setting&controller=jgrid_documents&format=ajax", method :'POST', params :{ 'task' :'read_chart_setting', 'option' :'com_jgrid', 'grid_id' : tbl_gridId, 'new_document_id':configSelectedSheetId }, success: function (response){ var server_response = Ext.decode(response.responseText); if(server_response.rows.lengt > 0){ //Load Old setting to the form Ext.getCmp('new_document_name').setValue(server_response.rows[0].document_title); if(server_response.rows[0].chart_category!="non_chart_sheet") { Ext.getCmp('chart_category').setValue(server_response.rows[0].chart_category); //Setting Chart Legend option Ext.getCmp('legendCbId').setValue(server_response.legend[0].position); Ext.getCmp('lable_padding').setValue(server_response.legend[0].padding); Ext.getCmp('colorpicker').setValue(server_response.legend[0].boxFill); Ext.getCmp('lable_x').setValue(server_response.legend[0].x); Ext.getCmp('lable_y').setValue(server_response.legend[0].y); if(server_response.legend[0].position=="relative"){ Ext.getCmp('lable_x').setVisible(true); Ext.getCmp('lable_y').setVisible(true); } else{ Ext.getCmp('lable_x').setVisible(false); Ext.getCmp('lable_y').setVisible(false); } //End of Chart Legend option //Traversing Chart series data if(server_response.chart_series.length>0) { var mydata = []; for(var i=0; i < server_response.chart_series.length; i++){ var temp = Array(); var tempYaxis=Array(); temp.push(server_response.chart_series[i].series_id); temp.push(server_response.chart_series[i].type); temp.push(server_response.chart_series[i].axis); temp.push(server_response.chart_series[i].xField); for(var j=0;j < server_response.chart_series[i].yField.length;j++){ tempYaxis.push(server_response.chart_series[i].yField[j].field_value); } temp.push(tempYaxis.toString()); temp.push(server_response.chart_series[i].stacked); temp.push(server_response.chart_series[i].highlight); mydata.push(temp); } series_gridStore.loadData(mydata, false); } switch(server_response.rows[0].chart_category) { case "cartesian": Ext.getCmp('numAxesConf').setVisible(true); Ext.getCmp('catAxesConf').setVisible(true); Ext.getCmp('naxes_position').setValue(server_response.numeric_axes[0].position); Ext.getCmp('naxes_title').setValue(server_response.numeric_axes[0].title); var tempNumericAxes = new Array(); for(var k=0;k < server_response.numeric_axes[0].fields.length;k++){ if(!Ext.isEmpty(server_response.numeric_axes[0].fields[k].field_value)){ tempNumericAxes.push(server_response.numeric_axes[0].fields[k].field_value); } Ext.getCmp('nFieldId').setValue(tempNumericAxes); } Ext.getCmp('caxes_position').setValue(server_response.category_axes[0].position); Ext.getCmp('ctitle').setValue(server_response.category_axes[0].title); //alert(server_response.category_axes[0].label_dgree_rotate); Ext.getCmp('label_dgree_rotate').setValue(server_response.category_axes[0].label_dgree_rotate); Ext.getCmp('catField').setValue(server_response.category_axes[0].cfields); break; case "pie": Ext.getCmp('numAxesConf').setVisible(false); Ext.getCmp('catAxesConf').setVisible(false); break; case "radar": Ext.getCmp('numAxesConf').setVisible(false); Ext.getCmp('catAxesConf').setVisible(false); break; } } } } }); } } }, title: "CREATE_NEW_SHEET", border: false, closeAction:"hide", items:[{ xtype: 'form', id: "JGridSheetSettingFm", fileUpload: true, buttonAlign: "center", //width: 450, frame: true, style: "margin: 0 auto;", dockedItems: [{ xtype: 'toolbar', dock: 'bottom', ui: 'footer', items: [ { xtype: 'button', text: 'Save', handler:function(){ //IF True use old code to create Grid Sheet var tbl_gridId = parseInt(Ext.getCmp('JGridSheetSettingWinId').getSelectedId()); var jgrid_id = parseInt(Ext.getCmp('JGridSheetSettingWinId').getArray_index()); var getGrid_reference_id = Ext.getCmp('JGridSheetSettingWinId').getGrid_reference_id(); var document_name = Ext.getCmp('new_document_name').getValue(); var documentIdStack = Ext.getCmp('JGridSheetSettingWinId').getDocumentIdStack(); var array_index = parseInt(Ext.getCmp('JGridSheetSettingWinId').getArray_index()); var arr_documentIdStack = JGrid.documentIdStack[jgrid_id]; var last_document_id = JGrid.documentIdStack[arr_documentIdStack.length - 1]; var sub_task = Ext.getCmp('JGridSheetSettingWinId').getTask(); var selected_sheetId = Ext.getCmp('JGridSheetSettingWinId').getSelectedSheetId(); //IF grid document radio is selected if(Ext.isEmpty(Ext.getCmp('new_document_name').getValue())){ Ext.MessageBox.alert("ALERT", "PLEASE_ENTER_SHEET_NAME"); Ext.getCmp('new_document_name').focus(); return false; } if(Ext.getCmp('sheettype_grid_rd').getValue()){ jgrid_create_grid_document(tbl_gridId, getGrid_reference_id, JGrid.documentIdStack[array_index], array_index,document_name); Ext.getCmp('JGridSheetSettingWinId').close(); } else if(Ext.getCmp('sheettype_chart_rd').getValue()){ // IF chart sheet option is selected // Logic for saving config values //Fetching Legend configoption var l_position = Ext.getCmp('legendCbId').getValue(); var l_padding = Ext.getCmp('lable_padding').getValue(); var l_colorpicker = Ext.getCmp('colorpicker').getValue(); var l_lable_x = Ext.getCmp('lable_x').getValue(); var l_lable_y = Ext.getCmp('lable_y').getValue(); var legendJsonStr = '{"position":"'+l_position+'","padding":"'+l_padding+'","boxFill":"'+l_colorpicker+'","x":"'+l_lable_x+'","y":"'+l_lable_y+'","labelFont":"Times New Roman"}'; //END var bgLine=false; var new_document_name = Ext.util.Format.stripTags(document_name); switch(Ext.getCmp('chart_category').getValue()){ case "cartesian": //Getting Numeric axes configuration data var naxes_position = Ext.getCmp('naxes_position').getValue(); var naxes_title = Ext.getCmp('naxes_title').getValue(); var gridbackgroundId =false; var nFieldId = Ext.getCmp('nFieldId').getValue(); var cat_ldgree = Ext.getCmp('label_dgree_rotate').getValue(); var series_data_string; if(Ext.getCmp('cgrid1').getValue()){ gridbackgroundId=true; } else if(Ext.getCmp('cgrid2').getValue()){ gridbackgroundId=false; } //Getting Category axes configuration data var caxes_position = Ext.getCmp('caxes_position').getValue(); var ctitle = Ext.getCmp('ctitle').getValue(); var catField = Ext.getCmp('catField').getValue(); var seriesSettingArray=[]; if(series_gridStore.getCount()<=0){ Ext.MessageBox.alert("ALERT", "PLEASE_ENTER_CHART_SERIES_FIRST"); return false; } else{ var series_records = new Array() var series_data = series_gridStore.each(function(rec){ var series_type =rec.get('series_type'); var series_axis =rec.get('series_axis'); var series_xaxis =rec.get('series_xaxis'); var series_yaxis =rec.get('series_yaxis'); var stacked_opt =rec.get('stacked_opt'); var highlight =rec.get('highlight'); var series_string ='{"series_type":"'+series_type+'","series_axis":"'+series_axis+'","series_xaxis":"'+series_xaxis+'","series_yaxis":"'+series_yaxis+'","stacked_opt":"'+stacked_opt+'","highlight":"'+highlight+'"}'; series_records.push(series_string); }); if(series_records.length>0){ series_data_string = "["+series_records.join()+"]"; } } Ext.Ajax.request({ waitMsg: "CREATING_SHEET",url: "https://www.edili.com/index.php?option=com_jgrid&task=create_chart_document&controller=jgrid_documents&format=ajax", method :'POST', params :{ 'task' :'create_chart_document', 'option' :'com_jgrid', 'grid_id' :tbl_gridId, 'sub_task' :sub_task, 'selected_sheetId' :selected_sheetId, 'last_document_id' :last_document_id, 'gridbackgroundId' :gridbackgroundId, 'new_document_name' :new_document_name, 'chart_category' :Ext.getCmp('chart_category').getValue(), 'legendJsonStr' :legendJsonStr, 'numeric_axes_config' :'{"naxes_position":"'+naxes_position+'","naxes_title":"'+naxes_title+'","nFieldId":"'+nFieldId+'"}', 'category_axes_config' :'{"caxes_position":"'+caxes_position+'","ctitle":"'+ctitle+'","catField":"'+catField+'","cat_ldgree":"'+cat_ldgree+'"}', 'series_data_config' :series_data_string }, success: function (response){ var server_response = Ext.decode(response.responseText); if (!server_response.success){ Ext.MessageBox.alert("CREATE_FAILED", "SHEET_CREATE_WAS_NOT_SUCCESSFULL"); Ext.getCmp('JGridSheetSettingWinId').close(); } else { var pgrid = Ext.ComponentMgr.get(getGrid_reference_id); var new_document_id = parseInt(server_response.rows.new_document_id); var combo_record = {id: new_document_id,document_title: new_document_name}; JGrid.documentStore[array_index-1].add(combo_record); var documentid=getGrid_reference_id+"_document"; Ext.ComponentMgr.get(documentid).setValue(new_document_id); Ext.ComponentMgr.get(documentid).setRawValue(new_document_name); JGrid.documentIdStack[array_index-1].push(new_document_id); pgrid.store.reload({ params:{ new_document_id: new_document_id, last_document_id: last_document_id } }); Ext.MessageBox.alert("CREATE_SUCCESS", "SHEET_CREATE_WAS_SUCCESSFULL"); Ext.getCmp('JGridSheetSettingWinId').close(); } }, failure: function (response) { Ext.MessageBox.alert("CREATE_FAILED", "SHEET_CREATE_WAS_NOT_SUCCESSFULL"); Ext.getCmp('JGridSheetSettingWinId').close(); } }); break; case "pie": var series_data_string; if(series_gridStore.getCount()<=0){ Ext.MessageBox.alert("CREATE_ALERT", "PLEASE_ENTER_CHART_SERIES"); return; } else{ var series_records = new Array() var series_data = series_gridStore.each(function(rec){ //alert(rec.get('series_type')); var series_type =rec.get('series_type'); var series_axis =rec.get('series_axis'); var series_xaxis =rec.get('series_xaxis'); var series_yaxis =rec.get('series_yaxis'); var stacked_opt =rec.get('stacked_opt'); var highlight =rec.get('highlight'); if(series_yaxis==""){ Ext.MessageBox.alert("CREATE_ALERT", "PLEASE_ENTER_CHART_SERIES"); return; } else if(series_yaxis!=""){ if(series_yaxis.split(",").length>1){ Ext.MessageBox.alert("CREATE_ALERT", "ONLY_ONE_FIELD_REQUIRED"); return false; } } var series_string ='{"series_type":"'+series_type+'","series_axis":"'+series_axis+'","series_xaxis":"'+series_xaxis+'","series_yaxis":"'+series_yaxis+'","stacked_opt":"'+stacked_opt+'","highlight":"'+highlight+'"}'; series_records.push(series_string); }); if(series_records.length>0){ series_data_string = "["+series_records.join()+"]"; } } Ext.Ajax.request({ waitMsg: "CREATING_SHEET",url: "https://www.edili.com/index.php?option=com_jgrid&task=create_chart_document&controller=jgrid_documents&format=ajax", method :'POST', params :{ 'task' :'create_chart_document', 'option' :'com_jgrid', 'grid_id' : tbl_gridId, 'sub_task' :sub_task, 'selected_sheetId' :selected_sheetId, 'last_document_id' :last_document_id, 'new_document_name' :new_document_name, 'legendJsonStr' :legendJsonStr, 'chart_category' :Ext.getCmp('chart_category').getValue(), 'series_data_config' :series_data_string }, success: function (response, options){ var server_response = Ext.decode(response.responseText); if (!server_response.success) { Ext.MessageBox.alert("CREATE_FAILED", "SHEET_CREATE_WAS_NOT_SUCCESSFULL"); Ext.getCmp('JGridSheetSettingWinId').close(); } else { var pgrid = Ext.ComponentMgr.get(getGrid_reference_id); var new_document_id = parseInt(server_response.rows.new_document_id); var combo_record = {id: new_document_id,document_title: new_document_name}; JGrid.documentStore[array_index-1].add(combo_record); var documentid=getGrid_reference_id+"_document"; Ext.ComponentMgr.get(documentid).setValue(new_document_id); Ext.ComponentMgr.get(documentid).setRawValue(new_document_name); JGrid.documentIdStack[array_index-1].push(new_document_id); pgrid.store.reload({ params:{ new_document_id: new_document_id, last_document_id: last_document_id } }); Ext.MessageBox.alert("CREATE_SUCCESS", "SHEET_CREATE_WAS_SUCCESSFULL"); Ext.getCmp('JGridSheetSettingWinId').close(); } }, failure: function (response) { Ext.MessageBox.alert("CREATE_FAILED", "SHEET_CREATE_WAS_NOT_SUCCESSFULL"); Ext.getCmp('JGridSheetSettingWinId').close(); } }); break; case "radar": var series_data_string; if(series_gridStore.getCount()<=0){ Ext.MessageBox.alert("ALERT", "PLEASE_ENTER_CHART_SERIES_FIRST"); } else{ var series_records = new Array() var series_data = series_gridStore.each(function(rec){ //alert(rec.get('series_type')); var series_type =rec.get('series_type'); var series_axis =rec.get('series_axis'); var series_xaxis =rec.get('series_xaxis'); var series_yaxis =rec.get('series_yaxis'); var stacked_opt =rec.get('stacked_opt'); var highlight =rec.get('highlight'); var series_string ='{"series_type":"'+series_type+'","series_axis":"'+series_axis+'","series_xaxis":"'+series_xaxis+'","series_yaxis":"'+series_yaxis+'","stacked_opt":"'+stacked_opt+'","highlight":"'+highlight+'"}'; series_records.push(series_string); }); if(series_records.length>0){ series_data_string = "["+series_records.join()+"]"; //alert(series_data_string); } } Ext.Ajax.request({ waitMsg: "CREATING_SHEET",url: "https://www.edili.com/index.php?option=com_jgrid&task=create_chart_document&controller=jgrid_documents&format=ajax", method :'POST', params :{ 'task' :'create_chart_document', 'option' :'com_jgrid', 'grid_id' : tbl_gridId, 'sub_task' :sub_task, 'selected_sheetId' :selected_sheetId, 'last_document_id' :last_document_id, 'new_document_name' :new_document_name, 'legendJsonStr' :legendJsonStr, 'chart_category' :Ext.getCmp('chart_category').getValue(), 'series_data_config' :series_data_string }, success: function (response){ var server_response = Ext.decode(response.responseText); if (!server_response.success) { Ext.MessageBox.alert("CREATE_FAILED", "SHEET_CREATE_WAS_NOT_SUCCESSFULL"); Ext.getCmp('JGridSheetSettingWinId').close(); } else { var pgrid = Ext.ComponentMgr.get(getGrid_reference_id); var new_document_id = parseInt(server_response.rows.new_document_id); var combo_record = {id: new_document_id,document_title: new_document_name}; JGrid.documentStore[array_index-1].add(combo_record); var documentid=getGrid_reference_id+"_document"; Ext.ComponentMgr.get(documentid).setValue(new_document_id); Ext.ComponentMgr.get(documentid).setRawValue(new_document_name); JGrid.documentIdStack[array_index-1].push(new_document_id); pgrid.store.reload({ params:{ new_document_id: new_document_id, last_document_id: last_document_id } }); Ext.MessageBox.alert("CREATE_SUCCESS", "SHEET_CREATE_WAS_SUCCESSFULL"); Ext.getCmp('JGridSheetSettingWinId').close(); } }, failure: function (response) { Ext.MessageBox.alert("CREATE_FAILED", "SHEET_CREATE_WAS_NOT_SUCCESSFULL"); Ext.getCmp('JGridSheetSettingWinId').close(); } }); break; } } } }, { xtype: 'button', text: 'Cancle', handler:function(){ Ext.getCmp('JGridSheetSettingWinId').close(); } } ] }], autoHeight: true, bodyStyle: "padding: 5px 5px 0px 5px;", labelWidth: 250, defaults:{ anchor: "100%", allowBlank: true, msgTarget: "side" }, items:[{ xtype:'textfield', name:'new_document_name', id: 'new_document_name', fieldLabel: 'PLEASE_ENTER_NEW_DOCUMENT_NAME', value:'DEFAULT_CHART_SHEET', allowBlank: false // requires a non-empty value }, { xtype : 'fieldcontainer', fieldLabel : 'SHEET_TYPE', defaultType: 'radiofield', defaults:{ flex:1 }, layout:'hbox', items:[ { boxLabel : 'GRID_FORMAT', name : 'sheettype', inputValue: 'g', checked :true, id : 'sheettype_grid_rd' } ,{ boxLabel : "CHART_FORMAT", name : "sheettype", inputValue: "c", checked :false, id : "sheettype_chart_rd", handler:function(){ if(this.getValue()){ Ext.getCmp("chartConfigId").setVisible(true); } else{ Ext.getCmp("chartConfigId").setVisible(false); } } } ] }, { layout:'auto', xtype:'panel', id:'chartConfigId', hidden:true, title: 'CHART_CONFIGURATION', items:[ { fieldLabel: 'CHART_CATEGORY', name:'chart_category', id:'chart_category', emptyText:'CHART_CATEGORY', xtype:'combo', store:chartCategoryCb, value:'cartesian', displayField:'chart_catVal', valueField:'chart_cat', listeners: { select: { fn: function (combo, records, eOpts) { if(combo.getValue()=="cartesian"){ /* *IF category is cartesian then *Show numeric & category Axes */ Ext.getCmp('numAxesConf').setVisible(true); Ext.getCmp('catAxesConf').setVisible(true); } else{ Ext.getCmp('numAxesConf').setVisible(false); Ext.getCmp('catAxesConf').setVisible(false); } } }, afterrender:{ fn: function (combo,eOpts) { //show Numeric config option if chart type is cartisian if(this.getValue()=="cartesian"){ Ext.getCmp('numAxesConf').setVisible(true); Ext.getCmp('catAxesConf').setVisible(true); } } } } },{ xtype:'panel', layout:'column', height:30, items:[{ columnWidth:0.14, xtype:'combo', fieldLabel:'LEGEND', labelWidth:50, id:'legendCbId', store:legendCb, displayField:'legendVal', valueField:'legendid', value:'left', listeners:{ select:{ fn: function (combo, records, eOpts) { //alert(combo.getValue()) if(combo.getValue()=="relative"){ Ext.getCmp('lable_x').setVisible(true); Ext.getCmp('lable_y').setVisible(true); } } } } }, { columnWidth: 0.18, name:'lable_padding', id:'lable_padding', fieldLabel:'PADDING_IN_PX', xtype:'numberfield', value: 10, maxValue:100, minValue:0 }, { columnWidth: 0.18, xtype:'pickerfield', fieldLabel:'BOX_FILL', labelWidth:50, id :'colorpicker', value:'#000000', createPicker:function() { return Ext.create('Ext.picker.Color', { resizable :true, floating: true, value:'000000', frame:true, select: function(selColor) { Ext.getCmp('colorpicker').setValue("#"+ selColor); var x = Ext.getCmp('colorpicker').getValue(); Ext.getCmp('colorpicker').setFieldStyle('background-color:'+x+' ;background-image: none;'); } }); } }, { columnWidth: 0.14, name:'lable_x', id:'lable_x', hidden:true, labelWidth:30, fieldLabel:'JX', xtype:'numberfield', value:0, maxValue:1000, minValue:0 }, { columnWidth:0.14, name:'lable_y', id:'lable_y', hidden:true, labelWidth:30, fieldLabel:'JY', xtype:'numberfield', maxValue:1000, value:0, minValue:0 } ] }, { xtype:'panel', layout:'column', items:[{ columnWidth: 0.5, xtype:'fieldset', id:'numAxesConf', hidden:false, title:'Numeric Axes Configuration', defaults: {anchor:'100%'}, layout: 'anchor', defaultType: 'textfield', items :[{ fieldLabel: 'AXES_POSITION', name:'naxes_position', id:'naxes_position', emptyText:'PLEASE_SELECT_NUMERIC_AXES', xtype:'combo', store:naxesCb, value:'left', displayField: 'pval', valueField: 'pid' }, { fieldLabel: 'TITLE', name: 'naxes_title', id:'naxes_title', xtype:'textfield', value:'NUMERIC_AXES_NAME', emptyText:'NUMERIC_AXES_NAME' }, { xtype :'fieldcontainer', name :'gridbackgroundId', id :'gridbackgroundId', fieldLabel : 'GRID_BACKGROUND', defaultType : 'radiofield', defaults:{ flex: 1 }, layout: 'hbox', items: [{ boxLabel : 'Sì', name : 'cgrid', inputValue: true, checked :true, id :'cgrid1' },{ boxLabel : 'No', name : 'cgrid', inputValue: false, id : 'cgrid2' } ] }, { fieldLabel : 'FIELDS', xtype :'combo', displayField:'text', id :'nFieldId', name :'nFieldId', queryMode :'local', multiSelect :true, valueField :'dataIndexVal', store :numFieldCb } ] }, { columnWidth: 0.5, xtype:'fieldset', hidden:false, title: 'CATEGORY_AXES_CONFIGURATION', id:'catAxesConf', defaultType: 'textfield', items :[{ fieldLabel:'AXES_POSITION', emptyText:'PLEASE_SELECT_AXES', name:'caxes_position', value:'bottom', id:'caxes_position', xtype:'combo', store:catPosStore, displayField:'cat_pval', valueField: 'cat_pid' }, { fieldLabel:'TITLE', name:'ctitle', id:'ctitle', xtype:'textfield', value:'CATEGORY_AXES_NAME', emptyText:'CATEGORY_AXES_NAME' }, { fieldLabel:'CATEGORY_LABLE_ALIGNMENT', name:'label_dgree_rotate', id:'label_dgree_rotate', xtype:'combo', valueField:'cat_ldgree', displayField:'cat_ldgreeVal', value:90, store :catLableStore, emptyText :'SELECT_DEGREE_TO_ROTATE' }, { fieldLabel:'FIELDS', xtype:'combo', id:'catField', name:'catField', displayField:'text', queryMode:'local', multiSelect:true, valueField:'dataIndexVal', store:catFieldCb }] }] }, { xtype:'panel', title:'Chart Series Configuration', items:[{ xtype:'gridpanel', height:150, id:'series_grid', store:series_gridStore, plugins:[ Ext.create('Ext.grid.plugin.RowEditing', { clicksToEdit: 1, listeners:{ edit:function(editor, e, eOpts ){ //alert(e.record.get('series_type')); e.record.commit(); //Ext.getCmp('series_grid').getStore().reload(); }, beforeedit:function(editor, e, eOpts){ //alert("asdasd 3333"+Ext.getCmp('chart_category').getValue()); } } }) ], dockedItems: [{ xtype: 'toolbar', dock: 'top', items: [{ xtype: 'button', text: 'Add Series to grid', handler:function(){ var rec = new Writer.chartSeries({ series_type: '', series_axis: '', series_xaxis: '', stacked_opt: '', highlight: '' }); Ext.getCmp('series_grid').getStore().insert(0, rec); //Ext.getCmp('series_grid').getStore().commite(); //Ext.getCmp('series_grid').getStore().reload(); } }, '-', { xtype: 'button', text: 'Remove', handler:function(){ var pgrid = Ext.getCmp('series_grid'); var sm = pgrid.getSelectionModel(); pgrid.getView().refresh(); if (sm.hasSelection()) { var sels = sm.getSelection(); var remove_sels = new Array(); Ext.Msg.show({ title: "Remove Row", buttons: Ext.MessageBox.YESNOCANCEL, msg: "Remove Selected Rows?", fn: function (btn) { if (btn == "yes"){ // Multiple row delete for(var i = 0, j = 0; i < sels.length; i++){ r = sels[i]; series_gridStore.remove(r); } pgrid.getView().refresh(); } } }); } } } ] }], columns:[ { header:'Series type', editor:Ext.create('Ext.form.ComboBox', { id:'series_chat_type', name:'series_chat_type', emptyText:'SELECT_CHART_TYPE', store:series_chart_type, displayField:'type_name', valueField:'type', listeners: { focus:{ fn:function(combo, records, eOpts){ if(Ext.getCmp('chart_category').getValue()=="cartesian"){ series_chart_type.filterBy(function (record) { if(record.get('type')=="pie" || record.get('type')=="radar"){ return false; } else{ return true; } }); } else if(Ext.getCmp('chart_category').getValue()=="pie"){ series_chart_type.filterBy(function (record) { if(record.get('type')=="pie"){ return true; } else{ return false; } }); } else if(Ext.getCmp('chart_category').getValue()=="radar"){ series_chart_type.filterBy(function (record) { if(record.get('type')=="radar"){ return true; } else{ return false; } }); } } }, select: { fn: function (combo, records, eOpts) { if(combo.getValue()=="bar" || combo.getValue()=="column"){ } else if(combo.getValue()=="pie"){ //Ext.MessageBox.alert("Alert","Pie type selected"); } } } } }), dataIndex: 'series_type' }, { header: 'Series axis', dataIndex: 'series_axis', editor:Ext.create('Ext.form.ComboBox', { name:'serise_chart_axisId', id:'serise_chart_axisId', emptyText:'PLEASE_SELECT_AXIS', store:naxesCb, displayField:'pval', valueField: 'pid' }) }, { header: 'Series xAxis Fields', dataIndex:'series_xaxis', editor:Ext.create('Ext.form.ComboBox', { id:'series_chart_xField', name :'series_chart_xField', displayField:'text', queryMode :'local', multiSelect :true, valueField :'dataIndexVal', store :catFieldCb }) }, { text:'Series yAxis Fields', dataIndex:'series_yaxis', editor:Ext.create('Ext.form.ComboBox',{ id:'series_chart_yField', name:'series_chart_yField', displayField:'text', queryMode:'local', multiSelect:true, valueField:'dataIndexVal', store:numFieldCb }) }, { text: 'Stacked', dataIndex: 'stacked_opt', editor:Ext.create('Ext.form.ComboBox', { id:'series_stackedCb_chart_Fld', emptyText:'SELECT_TYPE', store:stackedCb, displayField: 'stackedVal', valueField: 'stackedId', value:false }) }, { text:'highlight', dataIndex: 'highlight', editor:Ext.create('Ext.form.ComboBox', { id:'series_highlightCbFld', emptyText:'PLEASE_SELECT_TYPE', store:highlightCb, displayField: 'highlightVal', valueField: 'highlightId', value:true }) } ] }] }] } ] }] }); Ext.define("JGrid.view.JGridToolbar0.php", { extend : "Ext.toolbar.Toolbar", id : "JGridToolbar0", alias : "widget.JGridToolbar0", requires: [ "JGrid.view.JGridSheetSettingWin","Ext.data.Model"],items : [{ id: "Grid_return0", xtype: "button", // text: "MANAGE_SHEETS", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/arrow_left.png", hidden: true, tooltip: "RETURN_TO_PREVIOUS_GRID", handler: function () { last_grid_id = JGrid.lastGridIdStack[JGrid.lastGridIdStack.length - 1]; JGrid.lastGridIdStack.pop(); Ext.ComponentMgr.get("Grid_return0").hide(); grid_tabpanel.setActiveTab(last_grid_id); } }, { xtype: "tbtext", style: "font-weight:bold;", text: "SELECT_SHEET" }, { xtype: "combo", id: "Grid-20_document", emptyText: "SELECT_A_SHEET_TO_LOAD", store: JGrid.documentStore[0], displayField: "document_title", valueField: "id", width: 200, growToLongestValue: false, hideTrigger: false, lastquery:"", mode: "remote", value: "Public Sheet Grid20", typeAhead: true, editable: true, triggerAction: "all", listeners: { select:{ fn: function (combo, records, eOpts) { new_document_id = parseInt(records[0].data.id); last_document_id = 0; if (new_document_id === 0) { last_document_id = JGrid.documentIdStack[0].pop(); new_document_id = JGrid.documentIdStack[0] [JGrid.documentIdStack[0].length - 1]; var new_document_title = JGrid.documentStore[0].findRecord("id", new_document_id).data.document_title; Ext.ComponentMgr.get("Grid-20_document").setValue(new_document_title); if (new_document_id==0||new_document_id==null) { JGrid.documentIdStack[0].push(last_document_id); Ext.Msg.alert("END_OF_PREVIOUS_SHEETS", "PLEASE_SELECT_A_SHEET_FROM_THE_LIST"); return; } } else { last_document_id = JGrid.documentIdStack[0] [JGrid.documentIdStack[0].length - 1]; JGrid.documentIdStack[0].push(new_document_id); } var gridIdVal=parseInt(20); JGrid.view.Viewport.static_grid_id=gridIdVal; JGrid.view.Viewport.static_new_document_id=new_document_id; JGrid.view.Viewport.static_last_document_id=last_document_id; JGrid.view.Viewport.static_itemIndex =parseInt(0); JGrid.store[0].load({ params: { new_document_id: new_document_id, last_document_id: last_document_id } });if(records[0].get("document_type")){ Ext.getCmp("Chart_Mode0").setVisible(true); }else{ Ext.getCmp("Chart_Mode0").setVisible(false); } if(records[0].get("document_type")){ createDataChart(gridIdVal,new_document_id,last_document_id,Ext.getCmp("chartBody"),0); }} }, afterrender:function(cobObj,opt){ last_document_id = JGrid.documentIdStack[0] [JGrid.documentIdStack[0].length - 1]; var gridIdVal=parseInt(20); JGrid.documentStore[0].each(function(item, index, count) { if(last_document_id==item.get("id")){ if(item.get("document_type")){ Ext.getCmp("Chart_Mode0").setVisible(true); }else{ Ext.getCmp("Chart_Mode0").setVisible(false); } if(item.get("document_type")){ createDataChart(gridIdVal,last_document_id,last_document_id,Ext.getCmp("chartBody"),0); } } }); } }, scope: this }, { id:"Chart_Mode0", text:"Chart View", hidden:true, handler:function(){ var gridIdVal=parseInt(20); current_document_id = JGrid.documentIdStack[0] [JGrid.documentIdStack[0].length - 1]; var currentIndex=0; if(!JGrid.chartObj) { JGrid.chartObj = Ext.create("JGrid.view.JGridChartWindow",{ gridIdVal:gridIdVal, currentIndex:currentIndex, current_document_id:current_document_id }); chartObj=JGrid.chartObj; } JGrid.chartObj.show(); } }, { xtype: "tbtext", style: "font-weight:bold;", id: "spacer0", text: " " }, { xtype: "tbtext", style: "font-weight:bold;", id: "searchname0", text: "CERCA" }, { xtype: "textfield", id: "searchField0", hideLabel: true, width: 200, listeners: { specialkey: { fn: function ( field, e, opt ) { if(e.button == 12 || e.button == 9 || e.button == 13) { JGrid.searchstring[0] = field.value; JGrid.store[0].load({params: {searchString: JGrid.searchstring[0]}}); } } } } }, { id: "Edit_Mode0", text: "Edit", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/application_edit.png", cls: "x-btn-text-icon", hidden: true, tooltip: "ADD_GRID_ROW_TOOLTIP", handler: function () { // if(20<9&&demodata0==false) // { // Ext.Msg.alert("WARNING_CREATE_YOUR_OWN_GRIDS", "CHANGES_MADE_TO_DEMO_GRIDS_WILL_BE_LOST_WHEN_UPGRADEING"); // demodata0=true; // } Ext.ComponentMgr.get("Edit_Mode0").hide(); Ext.ComponentMgr.get("View_Mode0").show(); Ext.ComponentMgr.get("spacer0").hide(); Ext.ComponentMgr.get("searchname0").hide(); Ext.ComponentMgr.get("searchField0").hide(); JGrid.combo_store[1].load(); JGrid.editMode[0]=true; set_access_levels(0, "Grid-20", "Manage_Sheet_Access0", "Manage_Sheets0", "Add_Row_Above0", "Edit_Row0", JGrid.editMode[0] ); } }, { id: "View_Mode0", text: "View", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/application_view_columns.png", cls: "x-btn-text-icon", hidden: true, tooltip: "ADD_GRID_ROW_TOOLTIP", handler: function () { Ext.ComponentMgr.get("View_Mode0").hide(); Ext.ComponentMgr.get("Edit_Mode0").show(); Ext.ComponentMgr.get("spacer0").show(); Ext.ComponentMgr.get("searchname0").show(); Ext.ComponentMgr.get("searchField0").show(); // re-show any hidden images as backup to normal behavied of editor var grid_columns = Ext.ComponentMgr.get("Grid-20").columns; for(var i=1;i<=JGrid.columnCount[0];i++) { if(grid_columns[i].id.substr(0,1)=="P") { grid_columns[i].show(); } } JGrid.editMode[0]=false; set_access_levels(0, "Grid-20", "Manage_Sheet_Access0", "Manage_Sheets0", "Add_Row_Above0", "Edit_Row0" , JGrid.editMode[0]); } }, { id: "Add_Row_Above0", text: "ADD_GRID_ROW", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_row_insert.png", cls: "x-btn-text-icon", hidden: true, tooltip: "ADD_GRID_ROW_TOOLTIP", handler: function () { JGrid.add_row(ADD_ROW_BELOWW, "20", "Grid-20", 0); } }, { id: "Edit_Row0", xtype: "button", text: "ESPORTA", hidden: false, icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_edit.png", menu: [,{ id: "Download_data0", text: "SCARICA", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/database_go.png", handler: function() { JGrid.csvDownload["grid_id"] = 20; JGrid.csvDownload["document_id"] = JGrid.documentIdStack[0] [JGrid.documentIdStack[0].length - 1]; if(!JGrid.download_win) { JGrid.download_win = Ext.create("JGrid.view.JGridDownloadWin"); JGrid.data_downloader = Ext.getCmp("JGridDownloadFm"); } JGrid.download_win.show(); } }], scope: this }, { id: "Manage_Sheets0", xtype: "button", text: "MANAGE_SHEETS", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/folder_user.png", hidden: true, tooltip: "MANAGE_SHEETS_TOOLTIP", menu: [{ id: "Create_Sheets0", text: "CREATE_NEW_SHEET", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_add.png", tooltip: "CREATE_NEW_SHEET_TOOLTIP", handler: function () { // CHART Changes // globalSelectedGrid=20 //var array_index = JGrid.documentIdStack[0],0; if(!jgridSheetObj){ //Chart Config var jgridSheetObj= Ext.create("JGrid.view.JGridSheetSettingWin",{selectedId:"20",grid_reference_id:"Grid-20",documentIdStack:JGrid.documentIdStack[0],array_index:"0",task:"New",selectedSheetId:null}); } jgridSheetObj.show(); //alert(jgridSheetObj+"20"+"Grid-20"+ JGrid.documentIdStack[0],0); //alert(Ext.getCmp("Grid-20").getStore().getProxy().getModel().modelName.) //alert(Ext.getCmp("Grid-20").columns[2].text) // var grid_columns = Ext.ComponentMgr.get(grid_reference_id).columns; // alert("Grid-20") //jgrid_create_document("20", "Grid-20", JGrid.documentIdStack[0],0); // End } }, { id: "Delete_Sheets0", text: "DELETE_CURRENT_SHEET", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_delete.png", tooltip: "DELETE_CURRENT_SHEET_TOOLTIP", handler: function () { jgrid_remove_document("20", "Grid-20", JGrid.documentIdStack[0],0); } }, { id: "Copy_Sheets0", text: "COPY_CURRENT_SHEET", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_multiple.png", tooltip: "COPY_CURRENT_SHEET_TOOLTIP", handler: function () { jgrid_copy_document("20", "Grid-20", JGrid.documentIdStack[0],0); } },{ id: "Rename_Sheets0", text: "RENAME_CURRENT_SHEET", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_link.png", tooltip: "RENAME_CURRENT_SHEET_TOOLTIP", handler: function () { jgrid_rename_document("20", "Grid-20", JGrid.documentIdStack[0],0); } },{ id:"edit_chart_setting0", text:"EDIT_CURRENT_SHEET", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/table_multiple.png", tooltip: "EDIT_CURRENT_SHEET_TOOLTIP", handler: function () { last_document_id = JGrid.documentIdStack[0] [JGrid.documentIdStack[0].length - 1]; var gridIdVal=parseInt(20); JGrid.documentStore[0].each(function(item, index, count) { if(last_document_id==item.get("id")){ if(item.get("document_type")){ //IF chart then open edit chart setting window if(!jgridSheetObj){ var selectedSheetId=item.get("id"); var jgridSheetObj= Ext.create("JGrid.view.JGridSheetSettingWin",{selectedId:"20",grid_reference_id:"Grid-20",documentIdStack:JGrid.documentIdStack[0],array_index:"0",task:"Edit",selectedSheetId:selectedSheetId}); } jgridSheetObj.show(); } else{ Ext.MessageBox.confirm("Confirm", "Are you sure you want to edit this as chart sheet?", function(btn){ if(btn=="yes"){ //IF chart then open edit chart setting window if(!jgridSheetObj){ var selectedSheetId=item.get("id"); var jgridSheetObj= Ext.create("JGrid.view.JGridSheetSettingWin",{selectedId:"20",grid_reference_id:"Grid-20",documentIdStack:JGrid.documentIdStack[0],array_index:"0",task:"Edit",selectedSheetId:selectedSheetId}); } jgridSheetObj.show(); } }); } } }); // jgrid_copy_document("20", "Grid-20", JGrid.documentIdStack[0],0); } },{ id: "Manage_Sheet_Access0", text: "MANAGE_SHEET_ACCESS", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/key.png", tooltip: "ADD_GRID_COLUMNS_TOOLTIP", handler: function () { JGrid.combo_store[43].load({ params: { grid_id: JGrid.gCurrentGridId, grid_application_name: "mod_jgrid6" } }); JGrid.store_access.load({ params: { gird_id: JGrid.gCurrentGridId, grid_application_name: "mod_jgrid6" } }); JGrid.gCurrentGridId = "20"; if(!JGrid.JGridSecurityWin) { JGrid.JGridSecurityWin = Ext.create("JGrid.view.Security"); } JGrid.JGridSecurityWin.show(); } }]},{ id: "Print_Grid0", text: "STAMPA", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/printer.png", tooltip: "Stampa la tabella", handler: function () { Ext.ux.grid.Printer.print(Ext.ComponentMgr.get("Grid-20")); } },{ id: "user_help0", text: "HELP", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/help.png", tooltip: "INSTRUCTIONS_DESCRIBING_GRID_OPERATION", handler: function () { if(!JGrid.help[0]) { JGrid.help[0] = Ext.create("JGrid.view.JGridHelp"); } JGrid.help[0].show(); } } ] }); function createDataChart(grid_id,new_document_id,last_document_id,chartBodyObj,itemIndex) { var chartObj; Ext.Ajax.request({ waitMsg:"CREATING_SHEET", url:"https://www.edili.com/index.php?option=com_jgrid&task=read_chart_setting&controller=jgrid_documents&format=ajax", params: { task: "read_chart_setting", option: "com_jgrid", grid_id:grid_id, new_document_id: new_document_id, last_document_id: last_document_id }, method: "POST", failure: function (response, options) { }, success: function (response, options) { var server_response = Ext.decode(response.responseText); if (!server_response.success) { } else { var legend; if(!Ext.isEmpty(server_response.legend) && server_response.legend.length>0) { legend={}; //Adding position if(!Ext.isEmpty(server_response.legend[0].position)){ legend.position=server_response.legend[0].position; if(server_response.legend[0].position=="relative"){ legend.x=parseInt(server_response.legend[0].x); legend.y=parseInt(server_response.legend[0].y); } } if(!Ext.isEmpty(server_response.legend[0].padding)){ legend.padding=parseInt(server_response.legend[0].padding); } if(!Ext.isEmpty(server_response.legend[0].itemSpacing)){ legend.itemSpacing=parseInt(server_response.legend[0].itemSpacing); } if(!Ext.isEmpty(server_response.legend[0].boxFill)){ legend.boxFill=server_response.legend[0].boxFill; } if(!Ext.isEmpty(server_response.legend[0].labelFont)){ //legend.labelFont=server_response.legend[0].labelFont; } } else{ legend=false; } //Creating Chart if(chartObj!=""){ chartObj=""; } chartObj=Ext.create("Ext.chart.Chart",{ //animate: true, legend :legend, store: JGrid.store[itemIndex] }); JGrid.store[itemIndex].reload(); /* *Chart Serise configuration */ switch(server_response.rows[0].chart_category) { case "cartesian": //Creating Chart Category Config if(!Ext.isEmpty(server_response.category_axes) && server_response.category_axes.length>0 ){ chartObj.axes.add({ type: "Category", grid:(server_response.numeric_axes[0].gridbackgroundId == "true") ? true : false, position:server_response.category_axes[0].position, title:server_response.category_axes[0].title, minimum: 0, fields: [server_response.category_axes[0].cfields], label:{ rotate: { degrees: parseInt(server_response.category_axes[0].label_dgree_rotate) } } }); } if(!Ext.isEmpty(server_response.chart_radial_axes) && server_response.chart_radial_axes.length>0 ){ chartObj.axes.add({ type: "Radial", position:"radial", label:{ display: true } }); } /* *Configuring Numeric axes if exists */ if(!Ext.isEmpty(server_response.numeric_axes) && server_response.numeric_axes.length>0 ){ var fieldStr=[]; for(var i=0;i< server_response.numeric_axes[0].fields.length;i++){ fieldStr.push(server_response.numeric_axes[0].fields[i].field_value); } chartObj.axes.add({ type: "Numeric", title:server_response.numeric_axes[0].title, minimum: server_response.numeric_axes[0].minimum, position: server_response.numeric_axes[0].position, fields: fieldStr, minorTickSteps: server_response.numeric_axes[0].minorTickSteps, majorTickSteps:server_response.numeric_axes[0].majorTickSteps, grid:(server_response.numeric_axes[0].gridbackgroundId == "true") ? true : false }); } for(j=0;j < server_response.chart_series.length;j++){ var temp_xField = server_response.chart_series[j].xField; var temp_chartType = server_response.chart_series[j].type; var series_yField=[]; var series_labelTitle=[]; for(var i=0;i< server_response.chart_series[j].yField.length;i++){ series_yField.push(server_response.chart_series[j].yField[i].field_value); //Mapping dataindex with header for label title for(var k=0;k < JGrid.columns[itemIndex].length;k++){ if(JGrid.columns[itemIndex][k].dataIndex==server_response.chart_series[j].yField[i].field_value){ series_labelTitle.push(JGrid.columns[itemIndex][k].header); } } } // alert(server_response.chart_series[j].xField); chartObj.series.add({ type: server_response.chart_series[j].type, axis: server_response.chart_series[j].axis, highlight: server_response.chart_series[j].highlight, title:series_labelTitle, tips: { trackMouse: true, width: 140, height: 28, renderer: function(storeItem, item) { if(temp_chartType=="area"){ this.setTitle(storeItem.get(temp_xField)+":"+storeItem.get(item.storeField)); }else{ this.setTitle(storeItem.get(temp_xField) + ':'+String(item.value[1])); } } }, xField:server_response.chart_series[j].xField, yField:series_yField, stacked:server_response.chart_series[j].stacked }); } break; case "pie": for(j=0;j < server_response.chart_series.length;j++){ var temp_xField = server_response.chart_series[j].xField; var temp_chartType = server_response.chart_series[j].type; var series_yField=[]; var series_labelTitle=[]; for(var i=0;i< server_response.chart_series[j].yField.length;i++){ series_yField.push(server_response.chart_series[j].yField[i].field_value); //Mapping dataindex with header for label title for(var k=0;k < JGrid.columns[itemIndex].length;k++){ if(JGrid.columns[itemIndex][k].dataIndex==server_response.chart_series[j].yField[i].field_value){ series_labelTitle.push(JGrid.columns[itemIndex][k].header); } } } chartObj.series.add({ //type: server_response.chart_series[j].type, type: 'pie', highlight: server_response.chart_series[j].highlight, showInLegend: true, label: { field: server_response.chart_series[j].xField, display: 'rotate', contrast: true, font: '18px Arial' }, highlight: { segment: { margin: 40 } }, field:series_yField }); } break; case "radar": chartObj.axes.add({ type: "Radial", position: 'radial', label:{ display: true } }); for(j=0;j < server_response.chart_series.length;j++){ var temp_xField = server_response.chart_series[j].xField; var temp_chartType = server_response.chart_series[j].type; var series_yField=[]; var series_labelTitle=[]; for(var i=0;i< server_response.chart_series[j].yField.length;i++){ series_yField.push(server_response.chart_series[j].yField[i].field_value); //Mapping dataindex with header for label title for(var k=0;k < JGrid.columns[itemIndex].length;k++){ if(JGrid.columns[itemIndex][k].dataIndex==server_response.chart_series[j].yField[i].field_value){ series_labelTitle.push(JGrid.columns[itemIndex][k].header); } } } chartObj.series.add({ type: server_response.chart_series[j].type, xField:server_response.chart_series[j].xField, yField:series_yField, highlight:server_response.chart_series[j].highlight, showMarkers:true, markerConfig:{ radius: 4 }, style: { 'stroke-width': 2, fill: 'none' } }); } break; default: break; } //End of Switch chartBodyObj.add(chartObj); } }, scope: this }); } var groupingFeature0 = Ext.create("Ext.grid.feature.Grouping",{hideGroupedHeader: true,hideGroupedColumn: false, startCollapsed : false,markDirty: false });Ext.define("JGrid.view.JGridGrid0", { extend : "Ext.grid.Panel", alias : "widget.JGridGrid0", requires : [ "JGrid.view.JGridToolbar0", "JGrid.store.JGridStore0" ], id: "Grid-20",plugins: [ JGrid.editor[0] ],features: [{ ftype: "filters"},{ftype: "groupingsummary"}],enableDragDrop: true,enableColumnMove: false, store: JGrid.store[0], columns: JGrid.columns[0], selModel: Ext.create("Ext.selection.RowModel", { mode: "MULTI"}), tbar: {xtype: "JGridToolbar0"},frame: false,stripeRows: false,enableColumnResize: true,columnLines: false,beforeRender: function() { JGrid.grids[0] = Ext.ComponentMgr.get("Grid-20"); },onRender: function() {JGrid.application_name = "mod_jgrid6";JGrid.application_id = 7;JGrid.image_win = Ext.create("JGrid.view.JGridImageWin");if(!Ext.baseCSSPrefix) { Ext.baseCSSPrefix = "x-"; }Ext.create("Ext.ux.grid.Printer");Ext.ux.grid.Printer.stylesheetPath = "https://www.edili.com/components/com_jgrid/views/jgrid/js/app/ux/grid/gridPrinterCss/print.css";JGrid.thumbnail_win = Ext.create("JGrid.view.JGridThumbnailWin"); JGrid.thumbnail_loader = Ext.getCmp("JGridThumbnailFm");JGrid.store[0].load({ params: { // specify params for the first page load if using paging start: 0, limit: 50000 } }); JGrid.crossGridIdRef["Grid-20"]= 0; JGrid.crossReturnButtonIdRef[0]= "Grid_return0";Ext.grid.GridPanel.prototype.onRender.apply(this, arguments); this.addEvents("beforetooltipshow"); this.tooltip = new Ext.ToolTip({ renderTo: Ext.getBody(), // target: this.view.mainBody, listeners: { beforeshow: function(qt) { var v = this.getView(); var rowIndex = v.findRowIndex(qt.baseTarget); var columnIndex = v.findCellIndex(qt.baseTarget); var record = this.getStore().getAt(rowIndex); // Get the Record if(columnIndex==null || columnIndex == 0 || record ==null) { return false; } var fieldName = this.panel.columns[columnIndex].dataIndex; // Get field name var data = record.get(fieldName); if(data=="" || fieldName.substr(0,1)!="P" || JGrid.editMode[0]==true || data==null) { return false; } var data_array=data.split("~"); var tooltip = data_array[1]; this.fireEvent("beforetooltipshow", this, rowIndex, columnIndex, tooltip); }, scope: this } }); }, listeners: { //RMS tooltip for images render: function(g) { g.on("beforetooltipshow", function(grid, rowIndex, columnIndex, data) { //grid.tooltip.Ext.getBody().update("Tooltip for (" + row + ", " + col + ")"); grid.tooltip.Ext.getBody().update(data); }); }, celldblclick: function(grid, td, columnIndex, record, tr, rowIndex, e, eOpts) { // var record = grid.getStore().getAt(rowIndex); // Get the Record var fieldName = grid.panel.columns[columnIndex].dataIndex; // Get field name var data = String(record.get(fieldName)); JGrid.thumbnailImage["value"] = data; JGrid.thumbnailImage["grid_id"]= "Grid-20".substr(5); JGrid.thumbnailImage["column_id"] = fieldName.substr(1); JGrid.thumbnailImage["row_id"] = record.get("id"); JGrid.thumbnailImage["document_id"] = JGrid.documentIdStack[0] [JGrid.documentIdStack[0].length - 1]; JGrid.thumbnailImage["grid_index"] = 0; JGrid.thumbnailImage["column_index"] = columnIndex; JGrid.thumbnailImage["record"] = record; JGrid.thumbnailImage["fieldName"] = fieldName; JGrid.thumbnailImage["grid_reference_id"] = "Grid-20"; JGrid.thumbnailImage["grid_reference_id_document"] = "Grid-20_document"; // decode filename imagepath, tooltip, hyper_url, hyper_grid_sheet if(fieldName.substr(0,1)=="E") { var email_subject = grid.panel.columns[columnIndex].field.email_subject; // Get email_subject // replacing "emailsubject @!ROWID @!T23 @!T345 with rowid and column data values JGrid.thumbnailImage["email_subject"] = insertColumnData(email_subject, record); } if(fieldName.substr(0,1)=="P") { var data_array=data.split("~"); JGrid.thumbnailImage["image_path"] = data_array[0]; JGrid.thumbnailImage["tooltip"] = data_array[1]; //JGrid.thumbnailImage["hyper_url"] = data_array[2]; if(data_array[2]) { JGrid.thumbnailImage["hyper_url"] = insertColumnData(data_array[2], record); } JGrid.thumbnailImage["hyper_grid_sheet"] = data_array[3]; JGrid.thumbnailImage["extension"] = data_array[4]; JGrid.thumbnailImage["email"] = data_array[5]; if(JGrid.editMode[0]==false) { if(!data_array[6]) { // if subject blank insert default subject var defaultEmailSubject = grid.panel.columns[columnIndex].field.email_subject; // Get email_subject if(defaultEmailSubject) { data_array[6] = defaultEmailSubject; } } // replace wildcards with column data values any grid column data eg @T83 records all numbers after @T // any grid column data @!ROWID eg @!T83 records all numbers after @!T if(data_array[6]) { JGrid.thumbnailImage["email_subject"] = insertColumnData(data_array[6], record); } } JGrid.thumbnailImage["primary_key_value"] = String(record.get("")); } if(JGrid.editMode[0]==false) { // Show Image if(fieldName.substr(0,1)=="P" && (data.substr(0,5)=="/grid"||data.substr(0,5)=="/demo")||JGrid.thumbnailImage["extension"]=="swf") { if(data.substr(0,5)=="/demo") //path to demo data { var img_path = "https://www.edili.com/media/com_jgrid/image.php?demo=1&height="+JGrid.thumbnailImage["height"]+"&width="+JGrid.thumbnailImage["width"]+"&name="+JGrid.thumbnailImage["grid_id"]+"_"+JGrid.thumbnailImage["document_id"]+"_"+JGrid.thumbnailImage["grid_id"]+"_"+JGrid.thumbnailImage["document_id"]+"_"+JGrid.thumbnailImage["column_id"]+"_"+JGrid.thumbnailImage["row_id"]+"_"+JGrid.thumbnailImage["extension"]; var swf_path = "https://www.edili.com/media/com_jgrid/demo_images/grid_"+JGrid.thumbnailImage["grid_id"]+"/document_"+JGrid.thumbnailImage["document_id"]+"/"+JGrid.thumbnailImage["grid_id"]+"_"+JGrid.thumbnailImage["document_id"]+"_"+JGrid.thumbnailImage["column_id"]+"_"+JGrid.thumbnailImage["row_id"]+"_orig."+JGrid.thumbnailImage["extension"]; } else // path to user images { var img_path = "https://www.edili.com/media/com_jgrid/image.php?demo=0&height="+JGrid.thumbnailImage["height"]+"&width="+JGrid.thumbnailImage["width"]+"&name="+JGrid.thumbnailImage["grid_id"]+"_"+JGrid.thumbnailImage["document_id"]+"_"+JGrid.thumbnailImage["grid_id"]+"_"+JGrid.thumbnailImage["document_id"]+"_"+JGrid.thumbnailImage["column_id"]+"_"+JGrid.thumbnailImage["row_id"]+"_"+JGrid.thumbnailImage["extension"]; var swf_path = "https://www.edili.com/media/com_jgrid/grid_"+JGrid.thumbnailImage["grid_id"]+"/document_"+JGrid.thumbnailImage["document_id"]+"/"+JGrid.thumbnailImage["grid_id"]+"_"+JGrid.thumbnailImage["document_id"]+"_"+JGrid.thumbnailImage["column_id"]+"_"+JGrid.thumbnailImage["row_id"]+"_orig."+JGrid.thumbnailImage["extension"]; } //Ext.getCmp("image_win_id").load("localhost/joomla256a"); //RMS if(JGrid.thumbnailImage["extension"]=="swf") { if(!Ext.isEmpty(JGrid.flash_win)) { Ext.destroy(JGrid.flash_win); } JGrid.flash_url = swf_path; JGrid.flash_win = create_flash_window(); fwin = Ext.getCmp("flash_win_id"); JGrid.flash_win.show();if((!JGrid.thumbnailImage["hyper_url"])||JGrid.thumbnailImage["hyper_url"]=="Enter a URL...") { Ext.ComponentMgr.get("go_to_url2").hide(); } else { Ext.ComponentMgr.get("go_to_url2").show(); }if((!JGrid.thumbnailImage["email"])||JGrid.thumbnailImage["email"]=="Enter an EMAIL...") { Ext.ComponentMgr.get("go_to_email2").hide(); } else { Ext.ComponentMgr.get("go_to_email2").show(); }if(!JGrid.thumbnailImage["hyper_grid_sheet"]||JGrid.thumbnailImage["hyper_grid_sheet"]=="null"||"Go to Sheet") { Ext.ComponentMgr.get("go_to_sheet2").hide(); } else { Ext.ComponentMgr.get("go_to_sheet2").show(); }} else { if(!JGrid.image_win) { JGrid.image_win = Ext.create("JGrid.view.JGridImageWin"); } Ext.getCmp("image_win_id").load(img_path);if((!JGrid.thumbnailImage["hyper_url"])||JGrid.thumbnailImage["hyper_url"]=="Enter a URL...") { Ext.ComponentMgr.get("go_to_url").hide(); } else { Ext.ComponentMgr.get("go_to_url").show(); }if((!JGrid.thumbnailImage["email"])||JGrid.thumbnailImage["email"]=="Enter an EMAIL...") { Ext.ComponentMgr.get("go_to_email").hide(); } else { Ext.ComponentMgr.get("go_to_email").show(); }if(!JGrid.thumbnailImage["hyper_grid_sheet"]||JGrid.thumbnailImage["hyper_grid_sheet"]=="null") { Ext.ComponentMgr.get("go_to_sheet").hide(); } else { Ext.ComponentMgr.get("go_to_sheet").show(); } JGrid.image_win.show(); }return(false); } // check for url type window and open // RMS check with url else if(data!="" && (fieldName.substr(0,1)=="U"||grid.panel.columns.config[columnIndex].editor.vtype=="url")) else if(data!="" && (fieldName.substr(0,1)=="U")) { // Do replacements of wildcards in URL string // replace wildcards with column data values any grid column data eg @!T83 records all numbers after @!T // any grid column data @!ROWID eg @!T83 records all numbers after @!T data = insertColumnData(data, record); var index = data.indexOf("^"); var title = "image_window0"; if(index != -1) { title = data.substr(0, index); data = data.substr(index+1); } title=title.replace(" ",""); data=data.replace(" ",""); window.open(data, title); } else if(data!="" && (fieldName.substr(0,1)=="E") && JGrid.public_user == false) { JGrid.thumbnailImage["email"] = data; show_email_window(); } else if(data!="" && fieldName.substr(0,1)=="S") { } }else { // Store Image if(fieldName.substr(0,1)=="P" && access_level_array0[0]>"2") { JGrid.thumbnail_win.setPagePosition(e.getPageX()-50,e.getPageY()+15); //JGrid.thumbnail_win.setPosition(e.xy[0],e.xy[1]); // set to current value //JGrid.thumbnail_win.items.items[0].items.items[0].setValue(data); // set image to blank to encourage new upload Ext.ComponentMgr.get("photo").setValue(""); Ext.ComponentMgr.get("thumbtabs").setActiveTab(0); if(JGrid.thumbnailImage["image_path"]!=""&&JGrid.thumbnailImage["extension"]=="swf") { // Ext.ComponentMgr.get("photo").setValue(""); //if image already loaded then show upload for optional custom thumbnail Ext.ComponentMgr.get("thumbtabs").child("#JGridOptThumbFm").tab.show(); } else { Ext.ComponentMgr.get("thumbtabs").child("#JGridOptThumbFm").tab.hide(); } if(JGrid.thumbnailImage["tooltip"]!="") { Ext.ComponentMgr.get("imagetooltip").setValue(JGrid.thumbnailImage["tooltip"]); } if(JGrid.thumbnailImage["hyper_url"]!="") { Ext.ComponentMgr.get("image_url").setValue(JGrid.thumbnailImage["hyper_url"]); } if(JGrid.thumbnailImage["hyper_grid_sheet"]!="") { Ext.ComponentMgr.get("grid_sheet_title").setValue(JGrid.thumbnailImage["hyper_grid_sheet"]); } if(!JGrid.thumbnail_win) { JGrid.thumbnail_win = Ext.create("JGrid.view.JGridHelp"); } JGrid.thumbnail_win.show(); return(false); } } }, beforeedit: function (thisEditor,e) { if(JGrid.editMode[0]==false) return false; var grid_columns = e.grid.columns; var editable_line = e.record.get("editable_line"); if(editable_line!=true) { thisEditor.cancelEdit(); return(false); } // If sheet access level is view only as default look for columns and rows that are editable to user if(access_level_array0[0]<"3") { // look for columns that are "cell edit" for(var i=1;i panel": { // render: this.onPanelRendered } }); } });Ext.require([ 'Ext.window.Window', 'Ext.tab.*', 'Ext.*', 'Ext.toolbar.Spacer', 'Ext.layout.container.Card', 'Ext.ProgressBar', 'Ext.layout.container.Border' ]); Ext.define("JGrid.view.Viewport", { // As full page view port //extend : "Ext.container.Viewport", // as panel in joomla structure extend : "Ext.panel.Panel", layout: "border", statics: { static_grid_id: 0, static_new_document_id:0, static_last_document_id:0, static_itemIndex:0 }, requires : [ "JGrid.view.JGridGrid0" ],layout : "fit",renderTo: "jgrid_module6",width: 900,height: 750,title: "JGrid Tab Panel", items : [ { id : "jgrid_tabpanel", region: "center", xtype : "tabpanel", layout: "fit", enableTabScroll:true, margins: "5 5 0 0", activeTab: 0, listeners: { tabchange: function (tabpanel, tab) { if(tab.getId()!="chartTab"){ tab.items.items[0].store.load(); //tab.items.items[0].view.refresh(); } } }, items : [ { layout : "border", title: "Visualizzazione preiscrizioni", tabTip: "", height: 250, //width: 800, layout: "fit", id:"dataTab0", region : "center", items : [ { xtype : "JGridGrid0" } // , // { // region : "south", // xtype : "JGridGridDetail0" // } ] // end Selector items } ,{ title:'', hidden:true, hideMode:'offsets', id:'chartTab', items:[{ xtype:'JGridChartWin' }] }] // items of tab panel }] // items of Viewport }); Ext.define("JGrid.view.JGridChartWindow", { extend : "Ext.window.Window", alias :"widget.JGridChartWindow", layout:"fit", closeAction: "hide", minimizable: true, renderTo: "jgrid_module6", width: 700,height: 700,y: 10, maximizable: true, tbar: [ { xtype: 'button', text: "CHART_DATA", icon: "https://www.edili.com/administrator/components/com_jgrid/os/jgrid/icons/lightbulb.png" // tooltip: "FULL_INDEXED_HELP_TOPICS_ON_USING_JGRID" } ], listeners: { show:function(thisObj,eOption){ //alert(thisObj.currentIndex) createDataChart(thisObj.gridIdVal,thisObj.current_document_id,thisObj.current_document_id,thisObj,thisObj.currentIndex); }, close:function(objectWin,opt){ objectWin.removeAll(); } } }); Ext.define("JGrid.view.JGridChartToolbar", { extend : "Ext.toolbar.Toolbar", id : "JGridChartToolbar", alias : "widget.JGridChartToolbar", modal:true, requires : [ "Ext.data.Model"], items:[ { xtype: "tbtext", style: "font-weight:bold;", text: "SELECT_CHART_SHEET" }, { xtype: "combo", id:"chart_sheetCb", displayField: "document_title", valueField: "id", emptyText: "SELECT_A_SHEET_TO_LOAD", store:JGrid.chartStore, listeners: { select: { fn: function (combo, records, eOpts) { var gridIdVal=JGrid.view.Viewport.static_grid_id; var itemIndex = JGrid.view.Viewport.static_itemIndex; Ext.getCmp("chartBody").removeAll(); JGrid.store[itemIndex].load({ params: { new_document_id: combo.getValue(), last_document_id: combo.getValue() } }); JGrid.view.Viewport.static_new_document_id=combo.getValue(); JGrid.view.Viewport.static_last_document_id=combo.getValue(); createDataChart(gridIdVal,combo.getValue(),combo.getValue(),Ext.getCmp("chartBody"),itemIndex); } } } }, "-", { xtype:"button", text:"Switch to Data Grid", id:"backBtn", handler:function(){ Ext.getCmp("chartBody").removeAll(); var previousTabId="dataTab"+(JGrid.view.Viewport.static_itemIndex); Ext.getCmp("jgrid_tabpanel").setActiveTab(previousTabId); Ext.getCmp("jgrid_tabpanel").child("#chartTab").tab.hide(); } }]}); Ext.define("JGrid.view.JGridChartWin", { alias : "widget.JGridChartWin", floating: true, height: 600,y: 10, draggable:true, extend : "Ext.panel.Panel", tbar: {xtype: "JGridChartToolbar"}, layout: "fit", id:"chartBody" }); JGrid.documentIdStack[0] = new Array(); JGrid.documentIdStack[0].push(); JGrid.documentIdStack[0].push(28); //Ext.require([ "Ext.grid.*", "Ext.data.*", "Ext.util.*", "Ext.form.*", 'Ext.form.field.File', "Ext.grid.PagingScroller", "Ext.tip.*", "Ext.Button", "Ext.window.*" ]); Ext.require([ "Ext.grid.*", "Ext.data.*", "Ext.util.*", "Ext.form.*", 'Ext.form.field.File', "Ext.tip.*", "Ext.Button", "Ext.window.*" ]); Ext.Loader.setConfig({ enabled : true }); Ext.application({ // name of the application name : "JGrid", // define app folder //appFolder : "../../../../../joomla256/components/com_jgrid/views/jgrid/js/app", // Requires do not work with Joomla PHP so loaded instead in default.php to use Joomla namespace and then works in extjs mvc. //requires : [ "JGrid.view.Viewport" ], controllers: ["JGridController0"], launch : function() { // launch main tab view var task = Ext.create('Ext.util.DelayedTask', function () { Ext.create("JGrid.view.Viewport").show(); }); task.delay( 500 ); // reset to extjs document_id from mootools document_id //document.id = Ext.documentID; // shorthand alias var fm = Ext.form; // Initialize tool tips Ext.QuickTips.init(); } });

Prova

   70 anni dal 1947

  • Language

I TUOI CORSI

  • 0 articoli nel carrello