[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 44/107: fixup! fixup! Code cleaning : split d
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 44/107: fixup! fixup! Code cleaning : split database into database (for noalyss) and databasecore , with the functions |
Date: |
Mon, 26 Aug 2019 10:31:55 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit eb55afc103d315775f01adb7f2b4d0934175e170
Author: Dany De Bontridder <address@hidden>
Date: Thu Jul 25 21:24:44 2019 +0200
fixup! fixup! Code cleaning : split database into database (for noalyss)
and databasecore , with the functions
---
include/class/database.class.php | 21 +++++++++++++++++++++
include/lib/database_core.class.php | 36 +++++++-----------------------------
2 files changed, 28 insertions(+), 29 deletions(-)
diff --git a/include/class/database.class.php b/include/class/database.class.php
index eed0e60..71dce9c 100644
--- a/include/class/database.class.php
+++ b/include/class/database.class.php
@@ -222,4 +222,25 @@ class Database extends DatabaseCore
echo '</ul>';
}
+ /**
+ * return the name of the database with the domain name
+ * @param $p_id of the folder WITHOUT the domain name
+ * @param $p_type dos for folder mod for template
+ * @return formatted name
+ */
+ function format_name($p_id, $p_type)
+ {
+ switch ($p_type) {
+ case 'dos':
+ $sys_name = sprintf("%sdossier%d", strtolower(domaine), $p_id);
+ break;
+ case 'mod':
+ $sys_name = sprintf("%smod%d", strtolower(domaine), $p_id);
+ break;
+ default:
+ echo_error(__FILE__ . " format_name invalid type " . $p_type,
__LINE__);
+ throw new Exception(__FILE__ . " format_name invalid type " .
$p_type . __LINE__);
+ }
+ return $sys_name;
+ }
}
\ No newline at end of file
diff --git a/include/lib/database_core.class.php
b/include/lib/database_core.class.php
index 2b3bd9e..aa0aa59 100644
--- a/include/lib/database_core.class.php
+++ b/include/lib/database_core.class.php
@@ -57,17 +57,16 @@ class DatabaseCore
if ($this->db == false) {
if (DEBUG) {
- echo '<h2 class="error">Impossible de se connecter à
postgreSql !</h2>';
+ echo '<h2 class="error">'._('Impossible de se connecter à
postgreSql').'</h2>';
echo '<p>';
- echo "Vos paramètres sont incorrectes : <br>";
+ echo _("Vos paramètres sont incorrectes").": <br>";
echo "<br>";
- echo "base de donnée : $p_dbname<br>";
- echo "Port $p_port <br>";
- echo "Utilisateur : $p_user <br>";
+ printf (_("base de donnée = %s"), $p_dbname)."<br>";
+ printf (_("Port %s"),$p_port )."<br>";
+ printf ( _("Utilisateur : %s"),$p_user )."<br>";
echo '</p>';
- die("Connection impossible : vérifiez vos
paramètres de base
- de données");
+ die();
} else {
echo '<h2 class="error">' . _('Erreur de connexion !') .
'</h2>';
$this->is_open = false;
@@ -462,7 +461,7 @@ class DatabaseCore
$array = $this->get_array($p_sql, $p_array);
if (empty($array)) return null;
if (count($array) == 1) return $array[0];
- throw new Exception("Database:get_row retourne trop de lignes", 100);
+ throw new Exception(_("Database:get_row retourne trop de lignes"),
100);
}
/**
@@ -521,27 +520,6 @@ class DatabaseCore
return false;
}
- /**
- * return the name of the database with the domain name
- * @param $p_id of the folder WITHOUT the domain name
- * @param $p_type dos for folder mod for template
- * @return formatted name
- */
- function format_name($p_id, $p_type)
- {
- switch ($p_type) {
- case 'dos':
- $sys_name = sprintf("%sdossier%d", strtolower(domaine), $p_id);
- break;
- case 'mod':
- $sys_name = sprintf("%smod%d", strtolower(domaine), $p_id);
- break;
- default:
- echo_error(__FILE__ . " format_name invalid type " . $p_type,
__LINE__);
- throw new Exception(__FILE__ . " format_name invalid type " .
$p_type . __LINE__);
- }
- return $sys_name;
- }
/**
* Count the database name in a system view
- [Noalyss-commit] [noalyss] 84/107: Task #1734 Upgrade patch for PRINTTVA, (continued)
- [Noalyss-commit] [noalyss] 84/107: Task #1734 Upgrade patch for PRINTTVA, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 46/107: Code Cleaning split PDF into PDF_Core and PDF, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 105/107: fixup! New Task 1728: Aide à l'encodage - Journaux négatifs (note de crédit), Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 106/107: cosmetic, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 64/107: Add demo for fontello, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 75/107: Task #0001731: Moyen de paiement, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 81/107: Task #0001733: Impression moyen paiement, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 56/107: New function PDF_Core:is_fill add documentation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 38/107: load_all must always return an array, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 67/107: SQL : add constraint for payment_method, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 44/107: fixup! fixup! Code cleaning : split database into database (for noalyss) and databasecore , with the functions,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 36/107: Bug : card cannot use a attribute of the type "card", reason : the query was wrong and there were a confusion between this->name and this->id in "get_js_attr()", Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 47/107: Improve doxygen, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 51/107: Code Cleaning split sendmail between sendmail_core (not related to noalyss) and sendmail which is used by noalyss, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 54/107: Merge branch 'dev7109', Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 59/107: #0001729: Preference : ne plus recharger la page, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 85/107: Cosmetic : Icon_Trash in Todo_List, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 80/107: translation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 82/107: DatabaseCore fix silent when not debug, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 72/107: Improve message progress bar + translation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 94/107: Bug : Database::fetch_all returns an array or FALSE, because of pg_fetch_all, the version PHP7 cannot use anymore a boolean with count()., Dany De Bontridder, 2019/08/26