From f068c375a31929953503224140aea364177cf751 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 12 Jun 2015 21:35:48 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20PJ=20pour=20op=C3=A9rations=20diverses?= =?UTF-8?q?=20+=20correction=20proc=C3=A9dure=20de=20sauvegarde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/class_acc_ledger.php | 8 ++++++++ include/class_acc_ledger_fin.php | 5 +++-- include/class_database.php | 5 +++-- include/operation_ods_confirm.inc.php | 15 +++++++++++++-- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index d45571dd3..98879f3d7 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -2136,6 +2136,14 @@ class Acc_Ledger extends jrn_def_sql $orap->insert($jrn_concerned); } + /** + * Save the file is any + */ + if (isset($_FILES)) + { + $this->db->save_upload_document($seq); + } + } catch (Exception $a) { diff --git a/include/class_acc_ledger_fin.php b/include/class_acc_ledger_fin.php index bfdbcf15b..ee6670e22 100644 --- a/include/class_acc_ledger_fin.php +++ b/include/class_acc_ledger_fin.php @@ -947,8 +947,9 @@ class Acc_Ledger_Fin extends Acc_Ledger { if ($oid != 0) { - $this->db->exec_sql("update jrn set jr_pj=" . $oid . ", jr_pj_name='" . $_FILES['pj']['name'] . "', " . - "jr_pj_type='" . $_FILES['pj']['type'] . "' where jr_grpt_id=$seq"); + $this->db->exec_sql("update jrn set jr_pj=$1 , jr_pj_name=$2, + jr_pj_type=$3 where jr_grpt_id=$4", + array($oid,$_FILES['pj']['name'] ,$_FILES['pj']['type'],$seq)); } } } // for nbitem diff --git a/include/class_database.php b/include/class_database.php index 7599a97c7..23344c506 100644 --- a/include/class_database.php +++ b/include/class_database.php @@ -834,8 +834,9 @@ class Database pg_lo_unlink($cn, $old_oid); } // Load new document - $this->exec_sql("update jrn set jr_pj=".$oid.", jr_pj_name='".$_FILES['pj']['name']."', ". - "jr_pj_type='".$_FILES['pj']['type']."' where jr_grpt_id=$seq"); + $this->exec_sql("update jrn set jr_pj=$1 , jr_pj_name=$2, + jr_pj_type=$3 where jr_grpt_id=$4", + array($oid,$_FILES['pj']['name'] ,$_FILES['pj']['type'],$seq)); return $oid; } else diff --git a/include/operation_ods_confirm.inc.php b/include/operation_ods_confirm.inc.php index c2f958687..551fc8429 100644 --- a/include/operation_ods_confirm.inc.php +++ b/include/operation_ods_confirm.inc.php @@ -37,7 +37,7 @@ echo '
'; -echo '
'; +echo ''; echo HtmlInput::request_to_hidden(array('ac')); echo $ledger->confirm($_POST,false); @@ -45,10 +45,11 @@ echo $ledger->confirm($_POST,false); ?>
@@ -62,6 +63,16 @@ echo $ledger->confirm($_POST,false); echo $reverse_date->input(); ?>
+