diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index ecdbd7fd5..9bf1e45a5 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1355,6 +1355,10 @@ define([ config.msg = this.errorLabledColumnsPivot; break; + case Asc.c_oAscError.ID.PivotOverlap: + config.msg = this.errorPivotOverlap; + break; + case Asc.c_oAscError.ID.ForceSaveButton: config.msg = this.errorForceSave; break; @@ -2441,7 +2445,8 @@ define([ txtTab: 'Tab', txtFile: 'File', errorFileSizeExceed: 'The file size exceeds the limitation set for your server.
Please contact your Document Server administrator for details.', - errorLabledColumnsPivot: 'To create a pivot table, you must use data that is organized as a list with labeled columns.' + errorLabledColumnsPivot: 'To create a pivot table report, you must use data that is organized as a list with labeled columns.', + errorPivotOverlap: 'A pivot table report cannot overlap a table.' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js b/apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js index dfcff0c75..578f8a85a 100644 --- a/apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js +++ b/apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js @@ -191,15 +191,14 @@ define([ this.txtSourceRange.setValue((value) ? value : ''); this.dataSourceValid = value; + var me = this; this.txtSourceRange.validation = function(value) { - // var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Pivot, value, false); - // return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; - return true; + var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableData, value, false); + return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; }; this.txtDestRange.validation = function(value) { - // var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Pivot, value, false); - // return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; - return true; + var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableReport, value, false); + return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; }; } }, @@ -219,8 +218,8 @@ define([ isvalid = false; txtError = this.txtEmpty; } else { - // isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Pivot, this.txtSourceRange.getValue()); - // isvalid = (isvalid == Asc.c_oAscError.ID.No); + isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableData, this.txtSourceRange.getValue()); + isvalid = (isvalid == Asc.c_oAscError.ID.No); !isvalid && (txtError = this.textInvalidRange); } if (!isvalid) { @@ -234,8 +233,8 @@ define([ isvalid = false; txtError = this.txtEmpty; } else { - // isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Pivot, this.txtDestRange.getValue()); - // isvalid = (isvalid == Asc.c_oAscError.ID.No); + isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableReport, this.txtDestRange.getValue()); + isvalid = (isvalid == Asc.c_oAscError.ID.No); !isvalid && (txtError = this.textInvalidRange); } if (!isvalid) { @@ -274,7 +273,7 @@ define([ win.setSettings({ api : me.api, range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='source') ? me.dataSourceValid : me.dataDestValid), - type : Asc.c_oAscSelectionDialogType.Pivot + type : (type=='source') ? Asc.c_oAscSelectionDialogType.PivotTableData : Asc.c_oAscSelectionDialogType.PivotTableReport }); } }, diff --git a/apps/spreadsheeteditor/main/app/view/PivotSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/PivotSettingsAdvanced.js index 803fb38f4..500d8e07b 100644 --- a/apps/spreadsheeteditor/main/app/view/PivotSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/PivotSettingsAdvanced.js @@ -211,21 +211,20 @@ define([ 'text!spreadsheeteditor/main/app/template/PivotSettingsAdvanced.temp this.chHeaders.setValue(props.asc_getShowHeaders(), true); - // var value = props.getRange(); - // this.txtDataRange.setValue((value) ? value : ''); - // this.dataRangeValid = value; + var value = props.asc_getDataRef(); + this.txtDataRange.setValue((value) ? value : ''); + this.dataRangeValid = value; this.txtDataRange.validation = function(value) { - // var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Pivot, value, false); - // return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; - return true; + var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableData, value, false); + return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; }; - // var value = props.asc_getTitle(); - // this.inputAltTitle.setValue(value ? value : ''); - // - // value = props.asc_getDescription(); - // this.textareaAltDescription.val(value ? value : ''); + value = props.asc_getTitle(); + this.inputAltTitle.setValue(value ? value : ''); + + value = props.asc_getDescription(); + this.textareaAltDescription.val(value ? value : ''); } }, @@ -237,11 +236,12 @@ define([ 'text!spreadsheeteditor/main/app/template/PivotSettingsAdvanced.temp props.asc_setPageOverThenDown(this.radioOver.getValue()); props.asc_setPageWrap(this.numWrap.getNumberValue()); props.asc_setShowHeaders(this.chHeaders.getValue() == 'checked'); + props.asc_setDataRef(this.txtDataRange.getValue()); - // if (this.isAltTitleChanged) - // props.asc_putTitle(this.inputAltTitle.getValue()); - // if (this.isAltDescChanged) - // props.asc_putDescription(this.textareaAltDescription.val()); + if (this.isAltTitleChanged) + props.asc_setTitle(this.inputAltTitle.getValue()); + if (this.isAltDescChanged) + props.asc_setDescription(this.textareaAltDescription.val()); return props; }, @@ -254,8 +254,8 @@ define([ 'text!spreadsheeteditor/main/app/template/PivotSettingsAdvanced.temp isvalid = false; txtError = this.txtEmpty; } else { - // isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Pivot, this.txtDataRange.getValue()); - // isvalid = (isvalid == Asc.c_oAscError.ID.No); + isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableData, this.txtDataRange.getValue()); + isvalid = (isvalid == Asc.c_oAscError.ID.No); !isvalid && (txtError = this.textInvalidRange); } if (!isvalid) { @@ -290,7 +290,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PivotSettingsAdvanced.temp win.setSettings({ api : me.api, range : (!_.isEmpty(me.txtDataRange.getValue()) && (me.txtDataRange.checkValidate()==true)) ? me.txtDataRange.getValue() : me.dataRangeValid, - type : Asc.c_oAscSelectionDialogType.Pivot + type : Asc.c_oAscSelectionDialogType.PivotTableData }); } }, diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 877509930..24672e4b1 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -457,6 +457,7 @@ "SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored.", "SSE.Controllers.Main.errorWrongBracketsCount": "An error in the entered formula.
Wrong number of brackets is used.", "SSE.Controllers.Main.errorWrongOperator": "An error in the entered formula. Wrong operator is used.
Please correct the error.", + "SSE.Controllers.Main.errorPivotOverlap": "A pivot table report cannot overlap a table.", "SSE.Controllers.Main.leavePageText": "You have unsaved changes in this spreadsheet. Click 'Stay on this Page' then 'Save' to save them. Click 'Leave this Page' to discard all the unsaved changes.", "SSE.Controllers.Main.loadFontsTextText": "Loading data...", "SSE.Controllers.Main.loadFontsTitleText": "Loading Data",