got SOAP to work

This commit is contained in:
David Baldwynn 2015-10-30 13:14:48 -07:00
parent 92c84dc500
commit 2e5ccc9869
10 changed files with 22 additions and 17 deletions

View file

@ -128,8 +128,9 @@ exports.createSubmission = function(req, res) {
}
submission.save(function(err, submission){
// console.log('in submissions.save()\n submission: '+JSON.stringify(submission) );
// console.log('in submissions.save()\n submission: '+JSON.stringify(submission) )
if(err){
console.log(err.message);
res.status(400).send({
message: errorHandler.getErrorMessage(err)
});

View file

@ -211,6 +211,7 @@ FormSchema.pre('save', function (next) {
'spokenLanguage',
'title',
'DOB'];
next();
});
//Delete template PDF of current Form
FormSchema.pre('remove', function (next) {

View file

@ -103,9 +103,10 @@ FormFieldSchema.plugin(mUtilities.timestamp, {
useVirtual: false
});
// FormFieldSchema.pre('init', function (next){
// this.validFieldTypes = Field.schema.path('fieldType').enumValues;
// });
FormFieldSchema.pre('save', function (next){
this.validFieldTypes = mongoose.model('Field').schema.path('fieldType').enumValues;
next();
});
mongoose.model('Field', FormFieldSchema);

View file

@ -154,7 +154,9 @@ FormSubmissionSchema.pre('save', function (next) {
_generatedDemo['monthOfBirth'] = date.getMonth()+'';
}
}
_generatedDemo['lastUpdateDate'] = Date.now();
var currDate = new Date();
var dateString = currDate.toISOString().split('T')[0] + ' ' + currDate.toISOString().split('T')[1].slice(0,8);
_generatedDemo['lastUpdateDate'] = currDate.toISOString();
return _generatedDemo;
};
@ -193,7 +195,7 @@ FormSubmissionSchema.pre('save', function (next) {
if(err) next(err);
self.oscarDemoNum = parseInt(result.return, 10);
// console.log('self.oscarDemoNum: '+self.oscarDemoNum);
console.log('self.oscarDemoNum: '+self.oscarDemoNum);
next();
});
}else{

View file

@ -24,7 +24,7 @@ var exampleDemo = {
firstName: 'Test User',
hin: '',
lastName: 'AddDemographic',
lastUpdateDate: Date.now(),
lastUpdateDate: '2014-10-01 00:00:00',
monthOfBirth: '05',
officialLanguage: 'English',
phone: '250-222-2222',

View file

@ -93,7 +93,7 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$scope
$rootScope.myform = $scope.myform = response.data;
// console.log(response.data);
}).catch(function(response){
// console.log('Error occured during form UPDATE.\n');
console.log('Error occured during form UPDATE.\n');
// console.log(response.data);
err = response.data;
}).finally(function() {

View file

@ -64,8 +64,8 @@ angular.module('forms').directive('autoSaveForm', ['$rootScope', '$timeout', fun
//Update/Save Form if any Form fields are Dirty and Touched
$scope.$watch(function(newValue, oldValue) {
// console.log($scope);
// console.log($scope.$parent.editForm);
if($rootScope.finishedRender && $scope.anyDirtyAndTouched($scope.$parent.editForm) && !$rootScope.saveInProgress){
console.log($scope.editForm);
if($rootScope.finishedRender && $scope.anyDirtyAndTouched($scope.editForm) && !$rootScope.saveInProgress){
console.log('Form saving started');
debounceSave();
}
@ -98,18 +98,19 @@ angular.module('forms').directive('autoSaveForm', ['$rootScope', '$timeout', fun
// console.log('oldValue: '+oldValue);
// console.log(oldValue.form_fields);
// console.log(newValue.form_fields);
if(oldValue.form_fields.length === 0) $rootScope.finishedRender = true
//Save form ONLY IF rendering is finished, form_fields have been changed AND currently not save in progress
if($rootScope.finishedRender && ((changedFields && !$formCtrl.$dirty) || changedFieldMap) && !$rootScope.saveInProgress) {
if( $rootScope.finishedRender && ((changedFields && !$formCtrl.$dirty) || changedFieldMap) && !$rootScope.saveInProgress) {
console.log('saving form now');
// console.log('saving form now');
if(savePromise) {
$timeout.cancel(savePromise);
savePromise = null;
}
savePromise = $timeout(function() {
console.log('Saving Form');
// console.log('Saving Form');
debounceSave();
});
}

View file

@ -144,7 +144,6 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', '$q', '$ht
// Delete particular field on button click
$scope.deleteField = function (field_index){
$scope.myform.plugins.oscarhost.settings.fieldMap = {};
//Delete field from field map
var currFieldId = $scope.myform.form_fields[field_index]._id
delete $scope.myform.plugins.oscarhost.settings.fieldMap[currFieldId];

View file

@ -22,7 +22,7 @@ angular.module('forms').directive('onFinishRender', function ($rootScope, $timeo
}else if(scope.$last) {
scope.$evalAsync(function () {
// element.ready(function () {
// console.log(broadcastMessage+'Finished');
console.log(broadcastMessage+'Finished');
// console.log(Date.now());
$rootScope.$broadcast(broadcastMessage+' Finished');
// });

View file

@ -5,13 +5,13 @@
<label class="btn col-xs-3" ng-class="{activeBtn: field.fieldValue == field.fieldOptions[$index].option_id}">
<input ng-focus="setActiveField(field._id)"
type="radio"
value="{{option.option_id}}"
value="{{option.option_value}}"
ng-model="field.fieldValue"
ng-model-options="{ debounce: 250 }"
ng-required="field.required"
ng-disabled="field.disabled"
/>
<span ng-bind="option.option_title"></span>
<span ng-bind="option.option_value"></span>
</label>
</div>
</div>