noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 07/08: Ajout PJ pour opérations diverses + c


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 07/08: Ajout PJ pour opérations diverses + correction procédure de sauvegarde
Date: Fri, 12 Jun 2015 19:40:15 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit f068c375a31929953503224140aea364177cf751
Author: Dany De Bontridder <address@hidden>
Date:   Fri Jun 12 21:35:48 2015 +0200

    Ajout PJ pour opérations diverses + correction procédure de sauvegarde
---
 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 d45571d..98879f3 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 bfdbcf1..ee6670e 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 7599a97..23344c5 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 c2f9586..551fc84 100644
--- a/include/operation_ods_confirm.inc.php
+++ b/include/operation_ods_confirm.inc.php
@@ -37,7 +37,7 @@ echo '<div id="warning_ven_id" class="notice" style="width: 
50%; margin-left: 0p
 echo h2(_("Attention, cette opération n'est pas encore sauvée : vous devez 
encore confirmer"),' class="notice"');
 echo '</div>';
 
-echo '<FORM METHOD="POST" class="print">';
+echo '<FORM METHOD="POST" enctype="multipart/form-data" class="print">';
 echo HtmlInput::request_to_hidden(array('ac'));
 echo $ledger->confirm($_POST,false);
 
@@ -45,10 +45,11 @@ echo $ledger->confirm($_POST,false);
 ?>
 <div id="tab_id" >
     <script>
-        var a_tab = ['modele_div_id','reverse_div_id'];
+        var a_tab = ['modele_div_id','reverse_div_id','document_div_id'];
     </script>
 <ul class="tabs">
     <li class="tabs_selected"> <a href="javascript:void(0)" title="<?php echo 
_("Modèle à sauver")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'modele_div_id')">
 <?php echo _('Modèle')?> </a></li>
+    <li class="tabs"> <a href="javascript:void(0)" title="<?php echo 
_("Document")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'document_div_id')">
 <?php echo _('Document')?> </a></li>
     <li class="tabs"> <a href="javascript:void(0)" title="<?php echo 
_("Extourne")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'reverse_div_id')">
 <?php echo _('Extourne')?> </a></li>
 </ul>
     <div id="modele_div_id">
@@ -62,6 +63,16 @@ echo $ledger->confirm($_POST,false);
         echo $reverse_date->input();
     ?>
     </div>
+    <div id="document_div_id" style="display:none;height:185px;height:10rem">
+      <?php
+      $file = new IFile();
+        $file->table = 0;
+        echo '<p class="decale">';
+        echo _("Ajoutez une pièce justificative ");
+        echo $file->input("pj", "");
+        echo '</p>';
+        ?>
+    </div>
 </div>
 <?php
 echo HtmlInput::submit("save","Confirmer");



reply via email to

[Prev in Thread] Current Thread [Next in Thread]