-
-
-
+
diff --git a/Resources/public/js/Path/Partial/show.html b/Resources/public/js/Path/Partial/show.html
index 63e9499..1f7798d 100644
--- a/Resources/public/js/Path/Partial/show.html
+++ b/Resources/public/js/Path/Partial/show.html
@@ -2,20 +2,34 @@
-
+
diff --git a/Resources/public/js/Path/Service/PathService.js b/Resources/public/js/Path/Service/PathService.js
index 46d4d42..0dd9ef9 100644
--- a/Resources/public/js/Path/Service/PathService.js
+++ b/Resources/public/js/Path/Service/PathService.js
@@ -544,6 +544,7 @@
terminated = recursiveLoop(currentStep, currentStep.children[i]);
}
}
+
return terminated;
}
@@ -610,6 +611,7 @@
}
}
}
+
return deleted;
});
},
diff --git a/Resources/public/js/PathNavigation/Controller/PathNavigationBaseCtrl.js b/Resources/public/js/PathNavigation/Controller/PathNavigationCtrl.js
similarity index 62%
rename from Resources/public/js/PathNavigation/Controller/PathNavigationBaseCtrl.js
rename to Resources/public/js/PathNavigation/Controller/PathNavigationCtrl.js
index 0a46b38..4ea646e 100644
--- a/Resources/public/js/PathNavigation/Controller/PathNavigationBaseCtrl.js
+++ b/Resources/public/js/PathNavigation/Controller/PathNavigationCtrl.js
@@ -1,15 +1,13 @@
/**
* Class constructor
- * @returns {PathNavigationBaseCtrl}
+ * @returns {PathNavigationCtrl}
* @constructor
*/
-var PathNavigationBaseCtrl = function PathNavigationBaseCtrl($routeParams, $scope, PathService) {
+var PathNavigationCtrl = function PathNavigationCtrl($routeParams, $scope, PathService) {
this.pathService = PathService;
this.current = $routeParams;
- this.summaryState = this.pathService.getSummaryState();
-
// Watch the route changes
$scope.$watch(function watchCurrentRoute() {
return this.current;
@@ -27,30 +25,24 @@ var PathNavigationBaseCtrl = function PathNavigationBaseCtrl($routeParams, $scop
* Current matched route
* @type {object}
*/
-PathNavigationBaseCtrl.prototype.current = {};
+PathNavigationCtrl.prototype.current = {};
/**
* Current displayed step
* @type {object}
*/
-PathNavigationBaseCtrl.prototype.step = {};
+PathNavigationCtrl.prototype.step = {};
/**
* Parents of the current step
* @type {object}
*/
-PathNavigationBaseCtrl.prototype.parents = {};
-
-/**
- * Current state of the summary
- * @type {object}
- */
-PathNavigationBaseCtrl.prototype.summaryState = {};
+PathNavigationCtrl.prototype.parents = {};
/**
* Reload the Step from route params
*/
-PathNavigationBaseCtrl.prototype.reloadStep = function reloadStep() {
+PathNavigationCtrl.prototype.reloadStep = function reloadStep() {
this.step = null;
// Get step
@@ -66,11 +58,4 @@ PathNavigationBaseCtrl.prototype.reloadStep = function reloadStep() {
if (angular.isDefined(this.step) && angular.isObject(this.step)) {
this.parents = this.pathService.getParents(this.step);
}
-};
-
-/**
- * Allow toggle Summary from the current step
- */
-PathNavigationBaseCtrl.prototype.toggleSummary = function toggleSummary() {
- this.pathService.toggleSummaryState();
};
\ No newline at end of file
diff --git a/Resources/public/js/PathNavigation/Controller/PathNavigationEditCtrl.js b/Resources/public/js/PathNavigation/Controller/PathNavigationEditCtrl.js
deleted file mode 100644
index 7eb6191..0000000
--- a/Resources/public/js/PathNavigation/Controller/PathNavigationEditCtrl.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Class constructor
- * @returns {PathNavigationEditCtrl}
- * @constructor
- */
-var PathNavigationEditCtrl = function PathNavigationEditCtrl($routeParams, $scope, PathService) {
- // Call parent constructor
- PathNavigationBaseCtrl.apply(this, arguments);
-
- return this;
-};
-
-// Extends the base controller
-PathNavigationEditCtrl.prototype = Object.create(PathNavigationBaseCtrl.prototype);
-PathNavigationEditCtrl.prototype.constructor = PathNavigationEditCtrl;
\ No newline at end of file
diff --git a/Resources/public/js/PathNavigation/Controller/PathNavigationShowCtrl.js b/Resources/public/js/PathNavigation/Controller/PathNavigationShowCtrl.js
deleted file mode 100644
index 7fc7ebd..0000000
--- a/Resources/public/js/PathNavigation/Controller/PathNavigationShowCtrl.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Class constructor
- * @returns {PathNavigationShowCtrl}
- * @constructor
- */
-var PathNavigationShowCtrl = function PathNavigationShowCtrl($routeParams, $scope, PathService, UserProgressionService, StepConditionsService, AlertService) {
- // Call parent constructor
- PathNavigationBaseCtrl.apply(this, arguments);
-
- this.userProgressionService = UserProgressionService;
- this.userProgression = this.userProgressionService.get();
- this.stepConditionsService = StepConditionsService;
- this.alertService = AlertService;
- return this;
-};
-
-// Extends the base controller
-PathNavigationShowCtrl.prototype = Object.create(PathNavigationBaseCtrl.prototype);
-PathNavigationShowCtrl.prototype.constructor = PathNavigationShowCtrl;
-
-PathNavigationShowCtrl.prototype.goToStep = function goToStep(stepid) {
- var step = this.pathService.getStep(stepid);
- var curentStepId = step.id;
- var rootStep = this.pathService.getRoot();
-
- //make sure root is accessible anyways
- if (typeof this.userProgression[rootStep.id]=='undefined'
- || !angular.isDefined(this.userProgression[rootStep.id].authorized)
- || !this.userProgression[rootStep.id].authorized) {
- this.userProgressionService.update(rootStep, this.userProgression[rootStep.id].status, 1); //pass 1 (and not "true") to controller : problem in url
- }
- //previous step exists ? NO : we're on root step => access
- if (!angular.isObject(this.pathService.getPrevious(step))) {
- this.pathService.goTo(step);
- //previous step exists ? YES
- } else {
- var previousstep = this.pathService.getPrevious(step);
- //is there a flag authorized on current step ? YES => access
- if (typeof this.userProgression[curentStepId] !== 'undefined'
- && angular.isDefined(this.userProgression[curentStepId].authorized)
- && this.userProgression[curentStepId].authorized) {
- this.pathService.goTo(step);
- //is there a flag authorized on current step ? NO (or because the progression is not set)
- } else {
- //activity has been set for the step : NO => path error
- if (!angular.isDefined(previousstep.activityId)) {
- this.alertService.addAlert('error', Translator.trans('step_access_denied_no_activity_set', {stepName: step.name}, 'path_wizards'));
- //activity has been set for the step : YES
- } else {
- //is there a flag authorized on previous step ? YES
- if (typeof this.userProgression[previousstep.id] !== 'undefined'
- && angular.isDefined(this.userProgression[previousstep.id].authorized)
- && this.userProgression[previousstep.id].authorized) {
- //retrieve user progression
- var progression = this.userProgression[step.id];
- var status = (typeof progression == 'undefined') ? "seen" : progression.status;
- //is there a condition on previous step ? YES
- if (angular.isDefined(previousstep.condition) && angular.isObject(previousstep.condition)) {
- //get the promise
- var activityEvaluationPromise = this.stepConditionsService.getActivityEvaluation(previousstep.activityId);
- activityEvaluationPromise.then(
- function (result) {
- this.evaluation = result;
- // validate condition on previous step ? YES
- if (this.stepConditionsService.testCondition(previousstep, this.evaluation)) {
- //add flag to current step
- var promise = this.userProgressionService.update(step, status, 1);
- promise.then(function(result){
- //grant access
- this.pathService.goTo(step);
- }.bind(this)); //important, to keep the scope
- // validate condition on previous step ? NO
- } else {
- var conditionlist=this.stepConditionsService.getConditionList();
- //display error
- this.alertService.addAlert('error', Translator.trans('step_access_denied_condition', {stepName: step.name, conditionList: conditionlist}, 'path_wizards'));
- }
- }.bind(this),
- function (error) {
- this.evaluation = null;
- }.bind(this));
- //is there a condition on previous step ? NO
- } else {
- //add flag to current step
- var promise = this.userProgressionService.update(step, status, 1);
- promise.then(function(result){
- //grant access
- this.pathService.goTo(step);
- }.bind(this));
- }
- //is there a flag authorized on previous step ? NO => no access => message
- } else {
- //display error
- this.alertService.addAlert('error', Translator.trans('step_access_denied', {}, 'path_wizards'));
- }
- }
- }
- }
-};
\ No newline at end of file
diff --git a/Resources/public/js/PathNavigation/Directive/PathNavigationShowDirective.js b/Resources/public/js/PathNavigation/Directive/PathNavigationDirective.js
old mode 100755
new mode 100644
similarity index 69%
rename from Resources/public/js/PathNavigation/Directive/PathNavigationShowDirective.js
rename to Resources/public/js/PathNavigation/Directive/PathNavigationDirective.js
index e342c34..27ba383
--- a/Resources/public/js/PathNavigation/Directive/PathNavigationShowDirective.js
+++ b/Resources/public/js/PathNavigation/Directive/PathNavigationDirective.js
@@ -1,13 +1,13 @@
(function () {
'use strict';
- angular.module('PathNavigationModule').directive('pathNavigationShow', [
- function PathNavigationShowDirective() {
+ angular.module('PathNavigationModule').directive('pathNavigation', [
+ function PathNavigationDirective() {
return {
restrict: 'E',
replace: true,
- controller: PathNavigationShowCtrl,
- controllerAs: 'pathNavigationShowCtrl',
+ controller: PathNavigationCtrl,
+ controllerAs: 'pathNavigationCtrl',
templateUrl: AngularApp.webDir + 'bundles/innovapath/js/PathNavigation/Partial/show.html',
scope: {},
bindToController: true
diff --git a/Resources/public/js/PathNavigation/Directive/PathNavigationEditDirective.js b/Resources/public/js/PathNavigation/Directive/PathNavigationEditDirective.js
deleted file mode 100644
index 4e0b434..0000000
--- a/Resources/public/js/PathNavigation/Directive/PathNavigationEditDirective.js
+++ /dev/null
@@ -1,17 +0,0 @@
-(function () {
- 'use strict';
-
- angular.module('PathNavigationModule').directive('pathNavigationEdit', [
- function PathNavigationEditDirective() {
- return {
- restrict: 'E',
- replace: true,
- controller: PathNavigationEditCtrl,
- controllerAs: 'pathNavigationEditCtrl',
- templateUrl: AngularApp.webDir + 'bundles/innovapath/js/PathNavigation/Partial/edit.html',
- scope: {},
- bindToController: true
- };
- }
- ]);
-})();
\ No newline at end of file
diff --git a/Resources/public/js/PathNavigation/Directive/PathNavigationItemEditDirective.js b/Resources/public/js/PathNavigation/Directive/PathNavigationItemEditDirective.js
deleted file mode 100644
index 9940b69..0000000
--- a/Resources/public/js/PathNavigation/Directive/PathNavigationItemEditDirective.js
+++ /dev/null
@@ -1,21 +0,0 @@
-(function () {
- 'use strict';
-
- angular.module('PathNavigationModule').directive('pathNavigationItemEdit', [
- function PathNavigationEditDirective() {
- return {
- restrict: 'E',
- replace: true,
- controller: function PathNavigationItemEditCtrl() {},
- controllerAs: 'pathNavigationItemEditCtrl',
- templateUrl: AngularApp.webDir + 'bundles/innovapath/js/PathNavigation/Partial/edit-item.html',
- scope: {
- parent: '=?',
- element: '=',
- current: '='
- },
- bindToController: true
- };
- }
- ]);
-})();
\ No newline at end of file
diff --git a/Resources/public/js/PathNavigation/Directive/PathNavigationItemShowDirective.js b/Resources/public/js/PathNavigation/Directive/PathNavigationItemShowDirective.js
deleted file mode 100644
index b57eced..0000000
--- a/Resources/public/js/PathNavigation/Directive/PathNavigationItemShowDirective.js
+++ /dev/null
@@ -1,21 +0,0 @@
-(function () {
- 'use strict';
-
- angular.module('PathNavigationModule').directive('pathNavigationItemShow', [
- function PathNavigationShowDirective() {
- return {
- restrict: 'E',
- replace: true,
- controller: PathNavigationShowCtrl,
- controllerAs: 'pathNavigationItemShowCtrl',
- templateUrl: AngularApp.webDir + 'bundles/innovapath/js/PathNavigation/Partial/show-item.html',
- scope: {
- parent: '=?',
- element: '=',
- current: '='
- },
- bindToController: true
- };
- }
- ]);
-})();
\ No newline at end of file
diff --git a/Resources/public/js/PathNavigation/Partial/edit-item.html b/Resources/public/js/PathNavigation/Partial/edit-item.html
deleted file mode 100644
index d5a65f4..0000000
--- a/Resources/public/js/PathNavigation/Partial/edit-item.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
- {{ pathNavigationItemEditCtrl.element.name | truncate }}
-
-
- {{ pathNavigationItemEditCtrl.element.name | truncate }}
-
-
-
-
- {{ 'see_step_siblings'|trans:{}:'path_wizards' }}
-
-
-
\ No newline at end of file
diff --git a/Resources/public/js/PathNavigation/Partial/edit.html b/Resources/public/js/PathNavigation/Partial/edit.html
deleted file mode 100755
index 67d8e30..0000000
--- a/Resources/public/js/PathNavigation/Partial/edit.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
diff --git a/Resources/public/js/PathNavigation/Partial/show-item.html b/Resources/public/js/PathNavigation/Partial/show-item.html
index e3619ae..2a14f0c 100644
--- a/Resources/public/js/PathNavigation/Partial/show-item.html
+++ b/Resources/public/js/PathNavigation/Partial/show-item.html
@@ -1,22 +1,22 @@
-
+
-
+
- {{ pathNavigationItemShowCtrl.element.name | truncate }}
+ {{ pathNavigationItemCtrl.element.name | truncate }}
- {{ pathNavigationItemShowCtrl.element.name | truncate }}
+ {{ pathNavigationItemCtrl.element.name | truncate }}
-
+
{{ 'see_step_siblings'|trans:{}:'path_wizards' }}
-
\ No newline at end of file
diff --git a/Resources/public/js/PathNavigation/Partial/show.html b/Resources/public/js/PathNavigation/Partial/show.html
index 9c1496f..a89a98e 100644
--- a/Resources/public/js/PathNavigation/Partial/show.html
+++ b/Resources/public/js/PathNavigation/Partial/show.html
@@ -1,19 +1,13 @@
-
-
-
-
\ No newline at end of file
+
diff --git a/Resources/public/js/PathSummary/Controller/PathSummaryBaseCtrl.js b/Resources/public/js/PathSummary/Controller/PathSummaryBaseCtrl.js
index f0f04e3..7ce4d57 100644
--- a/Resources/public/js/PathSummary/Controller/PathSummaryBaseCtrl.js
+++ b/Resources/public/js/PathSummary/Controller/PathSummaryBaseCtrl.js
@@ -17,6 +17,7 @@ var PathSummaryBaseCtrl = function PathSummaryBaseCtrl($routeParams, PathService
// Set the structure of the path
this.structure = path.steps;
}
+
return this;
};
@@ -61,7 +62,6 @@ PathSummaryBaseCtrl.prototype.close = function close() {
* Go to a specific Step
* @param step
*/
-
PathSummaryBaseCtrl.prototype.goTo = function goTo(step) {
this.pathService.goTo(step);
};
\ No newline at end of file
diff --git a/Resources/public/js/PathSummary/Controller/PathSummaryEditCtrl.js b/Resources/public/js/PathSummary/Controller/PathSummaryEditCtrl.js
index 5c79ab8..f1151af 100644
--- a/Resources/public/js/PathSummary/Controller/PathSummaryEditCtrl.js
+++ b/Resources/public/js/PathSummary/Controller/PathSummaryEditCtrl.js
@@ -33,6 +33,7 @@ var PathSummaryEditCtrl = function PathSummaryEditCtrl($routeParams, PathService
this.pathService.reorderSteps(this.structure);
}.bind(this)
};
+
return this;
};
@@ -137,6 +138,7 @@ PathSummaryEditCtrl.prototype.removeStep = function (step) {
// Need to update preview
updatePreview = true;
}
+
// Effective remove
this.pathService.removeStep(this.structure, step);
@@ -153,6 +155,7 @@ PathSummaryEditCtrl.prototype.removeStep = function (step) {
}.bind(this)
);
};
+
PathSummaryEditCtrl.prototype.goTo = function goTo(step) {
//to avoid empty step
if (typeof this.current.stepId == 'undefined') {
diff --git a/Resources/public/js/PathSummary/Partial/edit.html b/Resources/public/js/PathSummary/Partial/edit.html
index e7d9ad2..03a8acb 100755
--- a/Resources/public/js/PathSummary/Partial/edit.html
+++ b/Resources/public/js/PathSummary/Partial/edit.html
@@ -1,8 +1,8 @@