[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 118/323: Progress Bar : use GET , which is fa
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 118/323: Progress Bar : use GET , which is faster than POST, use 2 decimal in progress because if the step is < 1 , it doesn't work |
Date: |
Wed, 14 Mar 2018 17:38:35 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 40cbb89f93882049aa6f2732d66d90038599a218
Author: Dany De Bontridder <address@hidden>
Date: Sat Feb 3 16:18:02 2018 +0100
Progress Bar : use GET , which is faster than POST, use 2 decimal in
progress because if the step is < 1 , it doesn't work
---
html/js/scripts.js | 1 +
include/class/document_export.class.php | 6 ++++--
include/lib/progress_bar.class.php | 1 +
sql/upgrade.sql | 2 +-
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/html/js/scripts.js b/html/js/scripts.js
index 6595ca9..614fdf0 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 ac632dd..fea8edc 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 50b1d08..f459fc1 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 21af50a..1b7e8d8 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()
);
- [Noalyss-commit] [noalyss] 94/323: Merge branch 'dev-6919.8', (continued)
- [Noalyss-commit] [noalyss] 94/323: Merge branch 'dev-6919.8', Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 108/323: Remove grant / revoke command, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 107/323: Add licence + template name, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 106/323: fix: cannot create new folder due to a typo error, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 91/323: FollowUp : improve esthetic, use inplace_edit for commenting on files, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 112/323: Change theme : corner for menu2 , no more border-radius for menu1, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 110/323: Correction couleur pour Inswitch_place Correction couleur pour Module sécurité, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 116/323: Improve progress_bar : add a blocking div, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 115/323: translate, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 119/323: Missing lib, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 118/323: Progress Bar : use GET , which is faster than POST, use 2 decimal in progress because if the step is < 1 , it doesn't work,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 117/323: Export PDF from ANC , add a progress_bar, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 16/323: Bug 1516 : réécriture du module période, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 111/323: History of analytic account the same way as the history for card or accounting, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 120/323: New LOGO, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 122/323: cosmetic menu level2, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 124/323: Fix : logo and new style by default, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 125/323: fix : managetable correct position, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 114/323: New : code for progress bar, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 129/323: Small bug : new structure for table version, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 126/323: fix : typo default theme Classic7, Dany De Bontridder, 2018/03/14