noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 12/13: Apply patch when creating a DB


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 12/13: Apply patch when creating a DB
Date: Mon, 30 Aug 2021 10:12:01 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit aefd06d997b738ef7cb27df671b16c6382d29bea
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Aug 29 16:02:04 2021 +0200

    Apply patch when creating a DB
---
 include/dossier.inc.php | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/dossier.inc.php b/include/dossier.inc.php
index 0319194..ee2d135 100644
--- a/include/dossier.inc.php
+++ b/include/dossier.inc.php
@@ -130,7 +130,7 @@ if ( isset ($_POST["DATABASE"]) )
             if ( strlen($year) != 4 || isNumber($year) == 0 || $year > 2100 || 
$year < 2000 || $year != round($year,0))
             {
                 echo "$year"._(" est une année invalide");
-                $Res=$repo->exec_sql("delete from ac_dossier where 
dos_id=$l_id");
+                $Res=$repo->exec_sql("delete from ac_dossier where 
dos_id=$1",[$l_id]);
             }
             else
             {
@@ -180,7 +180,16 @@ if ( isset ($_POST["DATABASE"]) )
                 Dossier::synchro_admin($l_id);
                 User::remove_inexistant_user($l_id);
                 User::audit_admin(sprintf('CREATE DATABASE %s %s',$l_id,$dos));
-
+               
+                // -- patch it if need
+                $db=new Database($l_id, 'dos');
+                echo h2("$l_id - $dos");
+                $db->apply_patch($db->format_name($l_id, "dos"));
+                
+                echo '<p class="text-center">';
+                echo HtmlInput::button_anchor(_("Retour"), 
"?action=dossier_mgt", uniqid(),"","button");
+                echo '</p>';
+                return ;
             }
         }
         else {



reply via email to

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