fixed form analyze view
This commit is contained in:
parent
83fe074f56
commit
faa306302b
|
@ -7,74 +7,14 @@ var mongoose = require('mongoose'),
|
|||
errorHandler = require('./errors.server.controller'),
|
||||
Form = mongoose.model('Form'),
|
||||
FormSubmission = mongoose.model('FormSubmission'),
|
||||
pdfFiller = require('pdffiller'),
|
||||
config = require('../../config/config'),
|
||||
fs = require('fs-extra'),
|
||||
async = require('async'),
|
||||
path = require('path'),
|
||||
diff = require('deep-diff'),
|
||||
_ = require('lodash');
|
||||
|
||||
/**
|
||||
* Upload PDF
|
||||
*/
|
||||
exports.uploadPDF = function(req, res, next) {
|
||||
|
||||
if(req.file){
|
||||
var pdfFile = req.file;
|
||||
var _user = req.user;
|
||||
var _path = req.file.path;
|
||||
|
||||
|
||||
if (req.file.size === 0) {
|
||||
return next(new Error('File uploaded is EMPTY'));
|
||||
}else if(req.file.size > 100000000){
|
||||
return next(new Error('File uploaded exceeds MAX SIZE of 100MB'));
|
||||
}else {
|
||||
fs.exists(_path, function(exists) {
|
||||
|
||||
//If file exists move to user's tmp directory
|
||||
if(exists) {
|
||||
|
||||
var newDestination = config.tmpUploadPath+_user.username;
|
||||
var stat = null;
|
||||
try {
|
||||
stat = fs.statSync(newDestination);
|
||||
} catch (err) {
|
||||
fs.mkdirSync(newDestination);
|
||||
}
|
||||
|
||||
if (stat && !stat.isDirectory()) {
|
||||
console.log('Directory cannot be created');
|
||||
return next(new Error('Directory cannot be created because an inode of a different type exists at "' + newDestination + '"'));
|
||||
}
|
||||
|
||||
console.log(path.join(newDestination, pdfFile.filename));
|
||||
|
||||
fs.move(pdfFile.path, path.join(newDestination, pdfFile.filename), function (err) {
|
||||
if (err) {
|
||||
return next(new Error(err.message));
|
||||
}
|
||||
pdfFile.path = path.join(newDestination, pdfFile.filename);
|
||||
console.log(pdfFile.filename + ' uploaded to ' + pdfFile.path);
|
||||
res.json(pdfFile);
|
||||
});
|
||||
|
||||
} else {
|
||||
return next(new Error('Did NOT get your file!'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}else {
|
||||
return next(new Error('Uploaded files were NOT detected'));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete a forms submissions
|
||||
*/
|
||||
exports.deleteSubmissions = function(req, res) {
|
||||
console.log(req.body);
|
||||
|
||||
var submission_id_list = req.body.deleted_submissions,
|
||||
form = req.form;
|
||||
|
@ -106,7 +46,6 @@ exports.deleteSubmissions = function(req, res) {
|
|||
* Submit a form entry
|
||||
*/
|
||||
exports.createSubmission = function(req, res) {
|
||||
|
||||
var form = req.form;
|
||||
|
||||
var submission = new FormSubmission({
|
||||
|
@ -118,8 +57,6 @@ exports.createSubmission = function(req, res) {
|
|||
percentageComplete: req.body.percentageComplete
|
||||
});
|
||||
|
||||
if(form.pdf) submission.pdf = form.pdf;
|
||||
|
||||
//Save submitter's IP Address
|
||||
if(req.headers['x-forwarded-for'] || req.connection.remoteAddress){
|
||||
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
||||
|
@ -130,27 +67,27 @@ exports.createSubmission = function(req, res) {
|
|||
submission.device = req.device;
|
||||
}
|
||||
|
||||
if(form.autofillPDFs){
|
||||
try {
|
||||
submission.fdfData = pdfFiller.convFieldJson2FDF(submission.form_fields);
|
||||
} catch(err){
|
||||
res.status(400).send({
|
||||
submission.save(function(err, submission){
|
||||
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
return res.status(500).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
}
|
||||
}else{
|
||||
submission.fdfData = null;
|
||||
}
|
||||
|
||||
submission.save(function(err, submission){
|
||||
form.submissions.push(submission);
|
||||
|
||||
form.save(function (err) {
|
||||
if (err) {
|
||||
console.log(err.message);
|
||||
res.status(500).send({
|
||||
console.error(err);
|
||||
return res.status(500).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
}
|
||||
res.status(200).send('Form submission successfully saved');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -159,25 +96,15 @@ exports.createSubmission = function(req, res) {
|
|||
exports.listSubmissions = function(req, res) {
|
||||
var _form = req.form;
|
||||
var _user = req.user;
|
||||
console.log('listSubmissions');
|
||||
|
||||
FormSubmission.find({ form: _form._id }).exec(function(err, _submissions) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
res.status(400).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
}
|
||||
|
||||
_form.update({ $set : { submissions: _submissions }}).exec(function(err, form){
|
||||
if (err) {
|
||||
console.log(err);
|
||||
console.error(err);
|
||||
res.status(400).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
}
|
||||
res.json(_submissions);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
@ -188,7 +115,6 @@ exports.listSubmissions = function(req, res) {
|
|||
*/
|
||||
exports.create = function(req, res) {
|
||||
|
||||
|
||||
if(!req.body.form){
|
||||
console.log(err);
|
||||
return res.status(400).send({
|
||||
|
@ -215,7 +141,18 @@ exports.create = function(req, res) {
|
|||
* Show the current form
|
||||
*/
|
||||
exports.read = function(req, res) {
|
||||
|
||||
FormSubmission.find({ form: req.form._id }).exec(function(err, _submissions) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
res.status(400).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var newForm = req.form.toJSON({virtuals : true});
|
||||
newForm.submissions = _submissions;
|
||||
|
||||
if (req.userId) {
|
||||
if(req.form.admin._id+'' === req.userId+''){
|
||||
|
@ -226,6 +163,7 @@ exports.read = function(req, res) {
|
|||
});
|
||||
}
|
||||
return res.json(newForm);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -235,7 +173,6 @@ exports.update = function(req, res) {
|
|||
var form = req.form;
|
||||
|
||||
if (req.body.changes) {
|
||||
console.log('SENDING DIFFS\n\n\n');
|
||||
var formChanges = req.body.changes;
|
||||
|
||||
formChanges.forEach(function (change) {
|
||||
|
|
|
@ -77,6 +77,16 @@ var VisitorDataSchema = new Schema({
|
|||
|
||||
});
|
||||
|
||||
var formSchemaOptions = {
|
||||
toObject: {
|
||||
virtuals: true
|
||||
},
|
||||
toJSON: {
|
||||
virtuals: true
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Form Schema
|
||||
*/
|
||||
|
@ -176,7 +186,7 @@ var FormSchema = new Schema({
|
|||
},
|
||||
font: String
|
||||
}
|
||||
});
|
||||
}, formSchemaOptions);
|
||||
|
||||
/*
|
||||
** In-Form Analytics Virtual Attributes
|
||||
|
|
|
@ -5,44 +5,15 @@
|
|||
*/
|
||||
var mongoose = require('mongoose'),
|
||||
Schema = mongoose.Schema,
|
||||
pdfFiller = require('pdffiller'),
|
||||
freegeoip = require('node-freegeoip'),
|
||||
_ = require('lodash'),
|
||||
config = require('../../config/config'),
|
||||
path = require('path'),
|
||||
fs = require('fs-extra'),
|
||||
mUtilities = require('mongoose-utilities'),
|
||||
soap = require('soap'),
|
||||
async = require('async'),
|
||||
FieldSchema = require('./form_field.server.model.js');
|
||||
|
||||
var FieldSchema = require('./form_field.server.model.js');
|
||||
|
||||
var newDemoTemplate = {
|
||||
address: '880-9650 Velit. St.',
|
||||
city: '',
|
||||
dateOfBirth: '10',
|
||||
displayName: 'LITTLE, URIAH',
|
||||
email: '',
|
||||
firstName: 'Uriah F.',
|
||||
hin: '',
|
||||
lastName: 'Little',
|
||||
lastUpdateDate: Date.now(),
|
||||
monthOfBirth: '05',
|
||||
officialLanguage: 'English',
|
||||
phone: '250-',
|
||||
phone2: '',
|
||||
postal: 'S4M 7T8',
|
||||
province: 'BC',
|
||||
sex: 'F',
|
||||
sexDesc: 'Female',
|
||||
sin: '',
|
||||
spokenLanguage: 'English',
|
||||
title: 'MS.',
|
||||
yearOfBirth: '2015'
|
||||
};
|
||||
|
||||
|
||||
// Setter function for form_fields
|
||||
function formFieldsSetter(form_fields) {
|
||||
for (var i = 0; i < form_fields.length; i++) {
|
||||
|
@ -50,7 +21,7 @@ function formFieldsSetter(form_fields) {
|
|||
form_fields[i].submissionId = form_fields[i]._id;
|
||||
form_fields[i]._id = new mongoose.mongo.ObjectID();
|
||||
}
|
||||
//console.log(form_fields)
|
||||
console.log(form_fields)
|
||||
return form_fields;
|
||||
}
|
||||
|
||||
|
@ -116,10 +87,6 @@ var FormSubmissionSchema = new Schema({
|
|||
type: Number
|
||||
},
|
||||
|
||||
//TODO: DAVID: Need to not have this hardcoded
|
||||
oscarDemoNum: {
|
||||
type: Number
|
||||
},
|
||||
|
||||
hasPlugins: {
|
||||
oscarhost: {
|
||||
|
@ -129,7 +96,17 @@ var FormSubmissionSchema = new Schema({
|
|||
}
|
||||
});
|
||||
|
||||
FormSubmissionSchema.path('form_fields').set(formFieldsSetter);
|
||||
FormSubmissionSchema.path('form_fields', {
|
||||
set: function(form_fields){
|
||||
for (var i = 0; i < form_fields.length; i++) {
|
||||
form_fields[i].isSubmission = true;
|
||||
form_fields[i].submissionId = form_fields[i]._id;
|
||||
form_fields[i]._id = new mongoose.mongo.ObjectID();
|
||||
}
|
||||
console.log(form_fields);
|
||||
return form_fields;
|
||||
}
|
||||
});
|
||||
|
||||
FormSubmissionSchema.plugin(mUtilities.timestamp, {
|
||||
createdPath: 'created',
|
||||
|
@ -137,35 +114,6 @@ FormSubmissionSchema.plugin(mUtilities.timestamp, {
|
|||
useVirtual: false
|
||||
});
|
||||
|
||||
//Oscarhost API hook
|
||||
FormSubmissionSchema.pre('save', function (next) {
|
||||
|
||||
var self = this;
|
||||
|
||||
if (this.hasPlugins.oscarhost) {
|
||||
mongoose.model('Form').findById(self.form, function (err, _form) {
|
||||
var form_ids = _.map(_.pluck(_form.form_fields, '_id'), function (id) {
|
||||
return '' + id;
|
||||
}),
|
||||
submission_ids = _.pluck(self.form_fields, '_id');
|
||||
|
||||
// console.log('Form form_field ids\n--------');
|
||||
// console.log(form_ids);
|
||||
// console.log('FormSubmission [form_field ids]\n--------');
|
||||
// console.log(submission_ids);
|
||||
|
||||
if (err) return next(err);
|
||||
// console.log(_form);
|
||||
// console.log('should push to api');
|
||||
// console.log( (!this.oscarDemoNum && !!_form.plugins.oscarhost.baseUrl && !!_form.plugins.oscarhost.settings.fieldMap) );
|
||||
return next();
|
||||
});
|
||||
} else {
|
||||
return next();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//Check for IP Address of submitting person
|
||||
FormSubmissionSchema.pre('save', function (next) {
|
||||
var self = this;
|
||||
|
@ -181,30 +129,4 @@ FormSubmissionSchema.pre('save', function (next) {
|
|||
return next();
|
||||
});
|
||||
|
||||
//Generate autofilled PDF if flags are set
|
||||
FormSubmissionSchema.pre('save', function (next) {
|
||||
var fdfData, dest_filename, dest_path,
|
||||
self = this,
|
||||
_form = this.form;
|
||||
|
||||
if (this.pdf && this.pdf.path) {
|
||||
dest_filename = self.title.replace(/ /g, '') + '_submission_' + Date.now() + '.pdf';
|
||||
var __path = this.pdf.path.split('/').slice(0, this.pdf.path.split('/').length - 1).join('/');
|
||||
dest_path = path.join(__path, dest_filename);
|
||||
|
||||
self.pdfFilePath = dest_path;
|
||||
|
||||
pdfFiller.fillForm(self.pdf.path, dest_path, self.fdfData, function (err) {
|
||||
if (err) {
|
||||
console.log('\n err.message: ' + err.message);
|
||||
return next(new Error(err.message));
|
||||
}
|
||||
console.log('Field data from Form: ' + self.title.replace(/ /g, '') + ' outputed to new PDF: ' + dest_path);
|
||||
return next();
|
||||
});
|
||||
} else {
|
||||
return next();
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = FormSubmissionSchema;
|
||||
|
|
|
@ -27,9 +27,6 @@ var upload = multer({
|
|||
|
||||
module.exports = function(app) {
|
||||
// Form Routes
|
||||
app.route('/upload/pdf')
|
||||
.post(auth.isAuthenticatedOrApiKey, upload.single('file'), forms.uploadPDF);
|
||||
|
||||
app.route('/forms')
|
||||
.get(auth.isAuthenticatedOrApiKey, forms.list)
|
||||
.post(auth.isAuthenticatedOrApiKey, forms.create);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
"async-boolean-expression-evaluator": "^1.1.1",
|
||||
"aws-sdk": "^2.3.9",
|
||||
"bcrypt": "^0.8.7",
|
||||
"bcrypt-nodejs": "0.0.3",
|
||||
"body-parser": "~1.14.1",
|
||||
"bower": "~1.6.5",
|
||||
"chalk": "^1.1.3",
|
||||
|
|
18
public/dist/application.js
vendored
18
public/dist/application.js
vendored
|
@ -1726,7 +1726,6 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$scope
|
|||
|
||||
$scope.copied = false;
|
||||
$scope.onCopySuccess = function(e) {
|
||||
console.log("COPY SUCCESSFUL!");
|
||||
$scope.copied = true;
|
||||
};
|
||||
|
||||
|
@ -1754,14 +1753,6 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$scope
|
|||
|
||||
|
||||
$scope.tabData = [
|
||||
/*{
|
||||
heading: $filter('translate')('CREATE_TAB'),
|
||||
templateName: 'create'
|
||||
},
|
||||
{
|
||||
heading: $filter('translate')('DESIGN_TAB'),
|
||||
templateName: 'design'
|
||||
},*/
|
||||
{
|
||||
heading: $filter('translate')('CONFIGURE_TAB'),
|
||||
templateName: 'configure'
|
||||
|
@ -2464,10 +2455,9 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
|||
(function initController(){
|
||||
|
||||
var defaultFormFields = _.cloneDeep($scope.myform.form_fields);
|
||||
var submissions = $scope.myform.submissions;
|
||||
|
||||
//Iterate through form's submissions
|
||||
|
||||
var submissions = _.cloneDeep($scope.myform.submissions);
|
||||
for(var i = 0; i < submissions.length; i++){
|
||||
for(var x = 0; x < submissions[i].form_fields; x++){
|
||||
var oldValue = submissions[i].form_fields[x].fieldValue || '';
|
||||
|
@ -2476,14 +2466,9 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
|||
}
|
||||
submissions[i].selected = false;
|
||||
}
|
||||
// console.log('after textField2: '+data[0].form_fields[1].fieldValue);
|
||||
|
||||
$scope.table.rows = submissions;
|
||||
|
||||
// console.log('form submissions successfully fetched');
|
||||
// console.log( JSON.parse(JSON.stringify($scope.submissions)) ) ;
|
||||
// console.log( JSON.parse(JSON.stringify($scope.myform.form_fields)) );
|
||||
|
||||
})();
|
||||
|
||||
/*
|
||||
|
@ -2497,7 +2482,6 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
|||
totalTime += $scope.table.rows[i].timeElapsed;
|
||||
}
|
||||
|
||||
console.log(totalTime/numSubmissions);
|
||||
return totalTime/numSubmissions;
|
||||
})();
|
||||
|
||||
|
|
10
public/dist/application.min.js
vendored
10
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
8
public/dist/form-application.min.js
vendored
8
public/dist/form-application.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,6 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$scope
|
|||
|
||||
$scope.copied = false;
|
||||
$scope.onCopySuccess = function(e) {
|
||||
console.log("COPY SUCCESSFUL!");
|
||||
$scope.copied = true;
|
||||
};
|
||||
|
||||
|
@ -26,29 +25,19 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$scope
|
|||
|
||||
$scope.formURL = "/#!/forms/" + $scope.myform._id;
|
||||
|
||||
if(window.location.host.split('.') < 3){
|
||||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host + "/#!/forms/" + $scope.myform._id;
|
||||
if(window.location.host.split('.').length < 3){
|
||||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host + $scope.formURL;
|
||||
} else {
|
||||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host.split('.').slice(1,3).join('.') + "/#!/forms/" + $scope.myform._id;
|
||||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host.split('.').slice(1,3).join('.') + $scope.formURL;
|
||||
}
|
||||
|
||||
|
||||
var refreshFrame = $scope.refreshFrame = function(){
|
||||
if(document.getElementById('iframe')) {
|
||||
document.getElementById('iframe').contentWindow.location.reload();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$scope.tabData = [
|
||||
/*{
|
||||
heading: $filter('translate')('CREATE_TAB'),
|
||||
templateName: 'create'
|
||||
},
|
||||
{
|
||||
heading: $filter('translate')('DESIGN_TAB'),
|
||||
templateName: 'design'
|
||||
},*/
|
||||
{
|
||||
heading: $filter('translate')('CONFIGURE_TAB'),
|
||||
templateName: 'configure'
|
||||
|
@ -62,6 +51,7 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$scope
|
|||
$scope.setForm = function(form){
|
||||
$scope.myform = form;
|
||||
};
|
||||
|
||||
$rootScope.resetForm = function(){
|
||||
$scope.myform = Forms.get({
|
||||
formId: $stateParams.formId
|
||||
|
|
|
@ -1,27 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope', '$http',
|
||||
function ($rootScope, $http) {
|
||||
angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope', '$http', 'Forms', '$stateParams', '$interval',
|
||||
function ($rootScope, $http, Forms, $stateParams, $interval) {
|
||||
return {
|
||||
templateUrl: 'modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html',
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
myform:'=',
|
||||
user:'='
|
||||
user:'=',
|
||||
myform: '@'
|
||||
},
|
||||
controller: function($scope){
|
||||
|
||||
$scope.table = {
|
||||
masterChecker: false,
|
||||
rows: []
|
||||
};
|
||||
|
||||
(function initController(){
|
||||
$scope.table.rows = [];
|
||||
|
||||
var initController = function(){
|
||||
|
||||
Forms.get({
|
||||
formId: $stateParams.formId
|
||||
}, function(form){
|
||||
console.log('running init controller');
|
||||
console.log(form);
|
||||
$scope.myform = form;
|
||||
var defaultFormFields = _.cloneDeep($scope.myform.form_fields);
|
||||
|
||||
//Iterate through form's submissions
|
||||
var submissions = $scope.myform.submissions || [];
|
||||
|
||||
var submissions = _.cloneDeep($scope.myform.submissions);
|
||||
//Iterate through form's submissions
|
||||
for(var i = 0; i < submissions.length; i++){
|
||||
for(var x = 0; x < submissions[i].form_fields; x++){
|
||||
var oldValue = submissions[i].form_fields[x].fieldValue || '';
|
||||
|
@ -30,15 +39,21 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
|||
}
|
||||
submissions[i].selected = false;
|
||||
}
|
||||
// console.log('after textField2: '+data[0].form_fields[1].fieldValue);
|
||||
|
||||
$scope.table.rows = submissions;
|
||||
|
||||
// console.log('form submissions successfully fetched');
|
||||
// console.log( JSON.parse(JSON.stringify($scope.submissions)) ) ;
|
||||
// console.log( JSON.parse(JSON.stringify($scope.myform.form_fields)) );
|
||||
});
|
||||
|
||||
})();
|
||||
};
|
||||
initController();
|
||||
|
||||
var updateFields = $interval(initController, 500);
|
||||
|
||||
$scope.$on("$destroy", function() {
|
||||
if (updateFields) {
|
||||
$interval.cancel($scope.updateFields);
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
** Analytics Functions
|
||||
|
@ -51,7 +66,6 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
|||
totalTime += $scope.table.rows[i].timeElapsed;
|
||||
}
|
||||
|
||||
console.log(totalTime/numSubmissions);
|
||||
return totalTime/numSubmissions;
|
||||
})();
|
||||
|
||||
|
@ -73,8 +87,7 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
|||
other: newStatItem()
|
||||
};
|
||||
|
||||
var visitors = $scope.myform.analytics.visitors;
|
||||
|
||||
if($scope.myform.analytics && $scope.myform.analytics.visitors) {
|
||||
for (var i = 0; i < visitors.length; i++) {
|
||||
var visitor = visitors[i];
|
||||
var deviceType = visitor.deviceType;
|
||||
|
@ -88,8 +101,8 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
|||
|
||||
stats[deviceType].completion = stats[deviceType].response / stats[deviceType].visits || 0;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(stats);
|
||||
return stats;
|
||||
})();
|
||||
|
||||
|
@ -156,16 +169,7 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
|||
'csv': 'csv'
|
||||
};
|
||||
|
||||
console.log($scope.table.rows);
|
||||
|
||||
angular.element('#table-submission-data').tableExport({type: type, escape:false});
|
||||
|
||||
/*
|
||||
var blob = new Blob([$scope.table.rows], {
|
||||
type: 'application/'+fileMIMETypeMap[type]+';charset=utf-8'
|
||||
});
|
||||
saveAs(blob, $scope.myform.title+'_sumbissions_export_'+Date.now()+'.'+type);
|
||||
*/
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
|
||||
<div class="col-xs-3">
|
||||
{{myform.analytics.submissions}}
|
||||
{{table.analytics.submissions}}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3">
|
||||
|
|
|
@ -44,7 +44,7 @@ angular.module('forms').config(['$stateProvider',
|
|||
templateUrl: 'modules/forms/admin/views/adminTabs/design.html'
|
||||
}).state('viewForm.analyze', {
|
||||
url: '/analyze',
|
||||
templateUrl: 'modules/forms/admin/views/adminTabs/analyze.html',
|
||||
templateUrl: 'modules/forms/admin/views/adminTabs/analyze.html'
|
||||
}).state('viewForm.create', {
|
||||
url: '/create',
|
||||
templateUrl: 'modules/forms/admin/views/adminTabs/create.html'
|
||||
|
|
Loading…
Reference in a new issue