Merge branch 'ent-12207-tarea-discovery-sale-como-done-cuando-esta-en-proceso' into 'develop'

Draft: Ent 12207 tarea discovery sale como done cuando esta en proceso

See merge request artica/pandorafms!6564
This commit is contained in:
Rafael Ameijeiras 2023-10-17 13:47:40 +00:00
commit ac1727e7d6
2 changed files with 13 additions and 7 deletions

View File

@ -1268,7 +1268,7 @@ class DiscoveryTaskList extends HTML
$status = db_get_value('status', 'trecon_task', 'id_rt', $id_task); $status = db_get_value('status', 'trecon_task', 'id_rt', $id_task);
if ($status < 0) { if ($status < 0) {
$status = 100; $status = '100';
} }
echo json_encode($status); echo json_encode($status);
@ -1287,7 +1287,6 @@ class DiscoveryTaskList extends HTML
$result = '<div class="flex">'; $result = '<div class="flex">';
$result .= '<div class="subtitle">'; $result .= '<div class="subtitle">';
$result .= '<span>'._('Overall Progress').'</span>'; $result .= '<span>'._('Overall Progress').'</span>';
$result .= '<div class="mrgn_top_25px">'; $result .= '<div class="mrgn_top_25px">';
$result .= progress_circular_bar( $result .= progress_circular_bar(
$task['id_rt'], $task['id_rt'],
@ -1973,7 +1972,6 @@ class DiscoveryTaskList extends HTML
{ {
$status = ''; $status = '';
$can_be_reviewed = false; $can_be_reviewed = false;
if (empty($task['summary']) === false if (empty($task['summary']) === false
&& $task['summary'] == 'cancelled' && $task['summary'] == 'cancelled'
) { ) {
@ -1991,11 +1989,9 @@ class DiscoveryTaskList extends HTML
$status = __('Done'); $status = __('Done');
} }
} else if ($task['utimestamp'] == 0 } else if ($task['utimestamp'] == 0
&& empty($task['summary']) && (bool) empty($task['summary']) === true
) { ) {
$status = __('Not started'); $status = __('Not started');
} else if ($task['utimestamp'] > 0) {
$status = __('Done');
} else { } else {
$status = __('Pending'); $status = __('Pending');
} }

View File

@ -3612,10 +3612,20 @@ function ui_progress(
page: "'.$ajax['page'].'" page: "'.$ajax['page'].'"
}, },
success: function(data) { success: function(data) {
let data_text = data;
if (data.includes("script")) {
const data_array = data_text.split("/script>");
data = data_array[1];
}
try { try {
val = JSON.parse(data); val = JSON.parse(data);
$("#'.$id.'").attr("data-label", val + " %"); $("#'.$id.'").attr("data-label", val + " %");
$("#'.$id.'_progress").width(val+"%");'; $("#'.$id.'_progress").width(val+"%");
let parent_id = $("#'.$id.'").parent().parent().attr("id");
if (val == 100) {
$("#"+parent_id+"-5").html("'.__('Finish').'");
}';
if (isset($ajax['oncomplete'])) { if (isset($ajax['oncomplete'])) {
$output .= ' $output .= '
if (val == 100) { if (val == 100) {