[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 52/219: task #0001372: Backup - nom du fichie
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 52/219: task #0001372: Backup - nom du fichier Bug modele.inc.php |
Date: |
Mon, 18 Dec 2017 13:22:37 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 9da90df28b0ced461f40e26a80c48741490a4a3f
Author: Dany De Bontridder <address@hidden>
Date: Thu Sep 14 22:35:25 2017 +0200
task #0001372: Backup - nom du fichier
Bug modele.inc.php
---
include/backup.inc.php | 20 +++++++++++++++++---
include/modele.inc.php | 2 +-
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/include/backup.inc.php b/include/backup.inc.php
index 7af8611..05e3f32 100644
--- a/include/backup.inc.php
+++ b/include/backup.inc.php
@@ -63,13 +63,21 @@ if ( isset ($_REQUEST['sa']) )
} else {
die ('Aucune connection');
}
-
+ $repo=new Database(0);
+ // compute file name with date
if ( $_REQUEST['t'] == 'd' )
{
+ // get folder name
+ $name = $repo->get_value("select dos_name from ac_dossier where
dos_id=$1",
+ array($dossier_number));
+
$database=domaine."dossier".$dossier_number;
+ $filename= str_replace(array('/','\\'
,'<','>','"','[',']',':','*',' ','{','}','&'),'_', $name);
+ $filename= str_replace("__", "_", $filename);
+ $filename.="-".date('Ymd');
$args= " -Fc -Z9 --no-owner -h ".getenv("PGHOST")." -p
".getenv("PGPORT")." ".$database;
header('Content-type: application/octet');
-
header('Content-Disposition:attachment;filename="'.$database.'.bin"',FALSE);
+
header('Content-Disposition:attachment;filename="'.$filename.'.bin"',FALSE);
passthru ($cmd.$args,$a);
@@ -77,10 +85,16 @@ if ( isset ($_REQUEST['sa']) )
if ( $_REQUEST['t'] == 'm' )
{
+ // get template name
+ $name = $repo->get_value("select mod_name from modeledef where
mod_id=$1",
+ array($dossier_number));
$database=domaine."mod".$dossier_number;
+ $filename= str_replace(array('/','\\'
,'<','>','"','[',']',':','*',' ','{','}','&'),'_', $name);
+ $filename= str_replace("__", "_", $filename);
+ $filename.="-".date('Ymd');
$args= " -Fc -Z9 --no-owner -h ".getenv("PGHOST")." -p
".getenv("PGPORT")." ".$database;
header('Content-type: bin/x-application');
- header('Content-Disposition:
attachment;filename="'.$database.'.bin"',FALSE);
+ header('Content-Disposition:
attachment;filename="'.$filename.'.bin"',FALSE);
$a=passthru ($cmd.$args);
}
}
diff --git a/include/modele.inc.php b/include/modele.inc.php
index 941d097..78d2b71 100644
--- a/include/modele.inc.php
+++ b/include/modele.inc.php
@@ -53,7 +53,7 @@ if (isset($_POST['upd']) &&
$cn = new Database();
-$fmod_dbid=$http->post("FMOD_DBID");
+$fmod_dbid=$http->post("FMOD_DBID","number",0);
// IF FMOD_NAME is posted then must add a template
if (isset($_POST["FMOD_NAME"]))
- [Noalyss-commit] [noalyss] 30/219: Task #0001443: opérations rapprochées : bug quand on utilise des tva avec autoliquidation 1. Correct export CSV 2. Improve code : new function Acc_Reconciliation:get_amount_noautovat, (continued)
- [Noalyss-commit] [noalyss] 30/219: Task #0001443: opérations rapprochées : bug quand on utilise des tva avec autoliquidation 1. Correct export CSV 2. Improve code : new function Acc_Reconciliation:get_amount_noautovat, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 133/219: #0001414: LETTRAGE - montants différents non indiqués Les montants différents pour un lettrage sont marqués avec un triangle orange Changement des requêtes SQL , peut avoir un prob. de performance pour gros volume, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 70/219: Task #0001475: VEN / ACH opération prédéfinie , il manque le bouton "Fermer", Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 131/219: Bug : correct catch clause , getMessage is wrong must be replaced by message, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 203/219: Task #0001507: Click sur détail opérations apparaît trop haut Fixed for IE8 : use documentElement.scrollTop, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 191/219: Database : improve message when exec_sql failed, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 185/219: Fix problem with invalid unicode sequence, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 178/219: NEW : add iselect , display a list with options, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 200/219: Task #0001507: Click sur détail opérations apparaît trop haut Use the function window.pageYOffset instead of window.scrollY, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 123/219: Anc ODS : check date is valid and comment not empty, remove debug, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 52/219: task #0001372: Backup - nom du fichier Bug modele.inc.php,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 55/219: Task #1469 Code Cleaning: remove Anc_Account Use a CSS with 2 fonts , one for the title and clickable item, and a normal one. Correct Anc_Account_Table::check duplicate for update and insert, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 152/219: HttpInput: Exception if the type is not known,, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 05/219: remove warning, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 13/219: Move Noalyss_SQL.class.php do the lib folder, Dany De Bontridder, 2017/12/18