@@ -1103,6 +1103,8 @@ function orEmptyArray(v) {
1103
1103
var parent = context . parent ;
1104
1104
var listName = context . listName ;
1105
1105
var modelName = context . outputModel . name ;
1106
+ var activityForm = context . activity && context . activity . type ;
1107
+ var formVersion = context . activity && context . activity . formVersion ;
1106
1108
1107
1109
self . listParent = context . parent ;
1108
1110
self . listName = listName ;
@@ -1131,7 +1133,10 @@ function orEmptyArray(v) {
1131
1133
self . downloadTemplate = function ( ) {
1132
1134
// Download a blank template if we are appending, otherwise download a template containing the existing data.
1133
1135
if ( self . appendTableRows ( ) ) {
1134
- var url = config . excelOutputTemplateUrl + '?listName=' + listName + '&type=' + modelName ;
1136
+ var url = config . excelOutputTemplateUrl + '?listName=' + listName + '&activityForm=' + activityForm + '&type=' + modelName ;
1137
+ if ( formVersion ) {
1138
+ url += '&formVersion=' + formVersion ;
1139
+ }
1135
1140
$ . fileDownload ( url )
1136
1141
. fail ( function ( error ) {
1137
1142
bootbox . alert ( 'File download failed! ' + error ) ;
@@ -1155,10 +1160,12 @@ function orEmptyArray(v) {
1155
1160
type : modelName ,
1156
1161
editMode : editMode || false ,
1157
1162
allowExtraRows : userAddedRows || false ,
1163
+ activityForm : activityForm ,
1164
+ formVersion : formVersion ,
1158
1165
data : JSON . stringify ( data )
1159
1166
} ;
1160
1167
var url = config . excelOutputTemplateUrl ;
1161
- $ . fileDownload ( url , {
1168
+ return $ . fileDownload ( url , {
1162
1169
httpMethod : 'POST' ,
1163
1170
data : params
1164
1171
} ) ;
0 commit comments