diff --git a/html/js/scripts.js b/html/js/scripts.js index 6595ca986..614fdf067 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -3438,6 +3438,7 @@ function progress_bar_check(p_idx, p_taskid) new Ajax.Request("ajax_misc.php", { parameters: {gDossier: 0, task_id: p_taskid,op:"progressBar"}, + method:"get", onSuccess: function (req) { try { diff --git a/include/class/document_export.class.php b/include/class/document_export.class.php index ac632ddbf..fea8edc71 100644 --- a/include/class/document_export.class.php +++ b/include/class/document_export.class.php @@ -127,7 +127,7 @@ class Document_Export $cnt_feedback=0; global $cn; // follow progress - $step=round(20/count($p_array)); + $step=round(16/count($p_array),2); $cn->start(); foreach ($p_array as $value) @@ -244,6 +244,7 @@ class Document_Export // concatenate detail operation with the output $stmt = PDFTK . " " . $detail_operation->get_pdf_filename()." ".$output. ' output ' . $output2; + $progress->increment($step); passthru($stmt, $status); if ($status <> 0) @@ -264,15 +265,16 @@ class Document_Export // Move the PDF into another temp directory $this->move_file($output, 'stamp_' . $file_pdf); } + $progress->set_value(93); // concatenate all pdf into one $this->concatenate_pdf(); - $progress->set_value(100); ob_clean(); $this->send_pdf(); + $progress->set_value(100); // remove files from "conversion folder" $this->clean_folder(); diff --git a/include/lib/progress_bar.class.php b/include/lib/progress_bar.class.php index 50b1d08d1..f459fc1ea 100644 --- a/include/lib/progress_bar.class.php +++ b/include/lib/progress_bar.class.php @@ -67,6 +67,7 @@ class Progress_Bar $this->value=0; $this->db->exec_sql("insert into progress(p_id,p_value) values ($1,0)", [$p_task_id]); + $this->db->exec_sql("delete from progress where p_created < now() - interval '3 hours' "); } } /** diff --git a/sql/upgrade.sql b/sql/upgrade.sql index 21af50a23..1b7e8d87c 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -13,7 +13,7 @@ alter table jnt_use_dos add CONSTRAINT use_id_dos_id_uniq UNIQUE (use_id,dos_id) create table progress ( p_id varchar(16) primary key, - p_value integer not null , + p_value numeric (5,2) not null , p_created timestamp default now() );