Skip to content

Commit

Permalink
[Js] fix: description risk
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Sep 29, 2021
1 parent 0a7cc71 commit 9ee305f
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions js/digiriskdolibarr.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -1296,18 +1296,29 @@
categoryPost = '&riskCategory=' + category;
}

var description = riskCommentText;
var descriptionPost = '';
if (description !== '') {
descriptionPost = '&riskComment=' + encodeURI(description);
if (riskCommentText) {
var description = riskCommentText;
var descriptionPost = '';
if (description !== '') {
descriptionPost = '&riskComment=' + encodeURI(description);
}
}

let elementParent = $('.fichecenter').find('.div-table-responsive');
window.eoxiaJS.loader.display($(this));
window.eoxiaJS.loader.display($(this).closest('.risk-row-content-' + editedRiskId).find('.risk-description-'+editedRiskId));
if (riskCommentText) {
window.eoxiaJS.loader.display($(this).closest('.risk-row-content-' + editedRiskId).find('.risk-description-'+editedRiskId));
}

var request = "";
if (riskCommentText) {
request = document.URL + '&action=saveRisk&riskID=' + editedRiskId + categoryPost + descriptionPost
} else {
request = document.URL + '&action=saveRisk&riskID=' + editedRiskId + categoryPost
}

$.ajax({
url: document.URL + '&action=saveRisk&riskID=' + editedRiskId + categoryPost + descriptionPost,
url: request,
type: "POST",
processData: false,
contentType: false,
Expand Down

0 comments on commit 9ee305f

Please sign in to comment.