admin: fix handling of description in claims
This commit is contained in:
parent
83ba3b88a5
commit
5849648c70
@ -1266,6 +1266,7 @@ angular.module("FICApp")
|
|||||||
else
|
else
|
||||||
$scope.fields = ["subject", "priority", "id_exercice", "id_assignee", "id_team", "creation", "state"];
|
$scope.fields = ["subject", "priority", "id_exercice", "id_assignee", "id_team", "creation", "state"];
|
||||||
$scope.assignees = ClaimAssignee.query();
|
$scope.assignees = ClaimAssignee.query();
|
||||||
|
$scope.comm = { ndescription: ""};
|
||||||
$scope.whoami = Math.floor(getCookie("myassignee"));
|
$scope.whoami = Math.floor(getCookie("myassignee"));
|
||||||
$scope.teams = Teams.get();
|
$scope.teams = Teams.get();
|
||||||
$scope.exercices = Exercice.query();
|
$scope.exercices = Exercice.query();
|
||||||
@ -1326,7 +1327,7 @@ angular.module("FICApp")
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
data: {
|
data: {
|
||||||
"id_assignee": $scope.whoami,
|
"id_assignee": $scope.whoami,
|
||||||
"content": $scope.ndescription
|
"content": $scope.comm.ndescription
|
||||||
}
|
}
|
||||||
}).then(function(response) {
|
}).then(function(response) {
|
||||||
$location.url("/claims/" + $scope.claim.id + "/");
|
$location.url("/claims/" + $scope.claim.id + "/");
|
||||||
@ -1342,7 +1343,7 @@ angular.module("FICApp")
|
|||||||
if (this.claim.id) {
|
if (this.claim.id) {
|
||||||
this.claim.$update(function(v) {
|
this.claim.$update(function(v) {
|
||||||
v.id_team = "" + v.id_team;
|
v.id_team = "" + v.id_team;
|
||||||
if ($scope.ndescription)
|
if ($scope.comm.ndescription)
|
||||||
$scope.saveDescription();
|
$scope.saveDescription();
|
||||||
else if (backToList)
|
else if (backToList)
|
||||||
$location.url("/claims/");
|
$location.url("/claims/");
|
||||||
@ -1355,8 +1356,8 @@ angular.module("FICApp")
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.claim.$save(function() {
|
this.claim.$save(function() {
|
||||||
if (!$scope.ndescription)
|
if (!$scope.comm.ndescription)
|
||||||
$scope.ndescription = "Création de la tâche";
|
$scope.comm.ndescription = "Création de la tâche";
|
||||||
$scope.saveDescription();
|
$scope.saveDescription();
|
||||||
}, function(response) {
|
}, function(response) {
|
||||||
$rootScope.newBox('danger', 'An error occurs when trying to save claim:', response.data.errmsg);
|
$rootScope.newBox('danger', 'An error occurs when trying to save claim:', response.data.errmsg);
|
||||||
|
@ -54,10 +54,10 @@
|
|||||||
<div class="col-lg-5">
|
<div class="col-lg-5">
|
||||||
|
|
||||||
<div class="form-group" ng-if="whoami">
|
<div class="form-group" ng-if="whoami">
|
||||||
<textarea class="form-control form-control-sm" placeholder="Ajouter un commentaire" rows="1" id="ndescription" ng-model="ndescription" autofocus></textarea>
|
<textarea class="form-control form-control-sm" placeholder="Ajouter un commentaire" rows="1" id="ndescription" ng-model="comm.ndescription"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group text-right" ng-show="claim.id && ndescription.length">
|
<div class="form-group text-right" ng-show="claim.id && comm.ndescription.length">
|
||||||
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Ajouter commentaire</button>
|
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Ajouter commentaire</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user