[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 05/33: IMPROVE #0002362: CCARDAT : Attribut d
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 05/33: IMPROVE #0002362: CCARDAT : Attribut de fiche Add control for element (choice) and allow to use VALUE(1, 1), (2, 2) |
Date: |
Thu, 18 Jul 2024 12:24:43 -0400 (EDT) |
sparkyx pushed a commit to branch unstable
in repository noalyss.
commit f7ea77efb3c968eed86d63cca44497788a9ac834
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Jun 15 13:07:34 2024 +0200
IMPROVE #0002362: CCARDAT : Attribut de fiche Add control for element
(choice) and allow to use VALUE(1,1), (2,2)
---
include/class/card_attribut_mtable.class.php | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/include/class/card_attribut_mtable.class.php
b/include/class/card_attribut_mtable.class.php
index 76ef2ffa2..80e7996fb 100644
--- a/include/class/card_attribut_mtable.class.php
+++ b/include/class/card_attribut_mtable.class.php
@@ -68,7 +68,7 @@ class Card_Attribut_MTable extends Manage_Table_SQL
}
/**
- * Display row of table attr_def
+ * @brief Display row of table attr_def
* @param array $row
*/
function display_row($row)
@@ -89,7 +89,7 @@ class Card_Attribut_MTable extends Manage_Table_SQL
}
/**
- * For the type custom , we can call a function to display properly the
value
+ * @brief For the type custom , we can call a function to display properly
the value
* @param $p_key string key name
* @param $p_value string value
* @see input_custom
@@ -125,7 +125,7 @@ class Card_Attribut_MTable extends Manage_Table_SQL
}
/**
- * For the type custom , we can call a function to display properly the
value
+ * @brief For the type custom , we can call a function to display properly
the value
* @param $p_key string key name
* @param $p_value string value
* @see input_custom
@@ -214,9 +214,29 @@ class Card_Attribut_MTable extends Manage_Table_SQL
$this->set_error("ad_extra", _("La requête SQL est vide "));
}
+ $cn= $this->get_table()->cn;
+ $cn->start();
+ try {
+ // remove SQL command like insert , delete , update, truncate
, drop
+ $sql=$object_sql->ad_extra;
+ $sql=str_ireplace("delete", "del.ete", $sql);
+ $sql=str_ireplace("insert", "del.ete", $sql);
+ $sql=str_ireplace("update", "del.ete", $sql);
+ $sql=str_ireplace("truncate", "del.ete", $sql);
+ $sql=str_ireplace("drop", "del.ete", $sql);
+ $cn->exec_sql($sql);
+
+ } catch (\Exception $e) {
+ $this->set_error("ad_extra", _("ERREUR SQL : ")
+ .$object_sql->ad_extra);
+ } finally {
+ $cn->rollback();
+ }
+
+
if (preg_match('/^\h*select/i', $object_sql->ad_extra)==0)
{
- $this->set_error("ad_extra", _("La requête SQL doit commencer
par SELECT "));
+
}
}
if ( $object_sql->ad_default_order < 11 ||
$object_sql->ad_default_order > 9998) {
- [Noalyss-commit] [noalyss] 29/33: ODS : cosmetic detail operation, not aligned, (continued)
- [Noalyss-commit] [noalyss] 29/33: ODS : cosmetic detail operation, not aligned, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 07/33: remove euro symbole, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 16/33: cosmetic : improve appearance, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 19/33: ACH-13 : extourne also analytic, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 23/33: Bug : ven-3 duplicate does not work with currency : incorrect amount, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 24/33: allow many-to-many lettering + cosmetic, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 20/33: Fix cosmetic : export Operation PDF: anc not printed properly, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 21/33: Fix Bug Cosmetic: appearance : color of menu1, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 03/33: IMPROVE #0002362: CCARDAT : Attribut de fiche Add control for element (choice) and allow to use VALUE(1, 1), (2, 2), dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 01/33: tag 9206, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 05/33: IMPROVE #0002362: CCARDAT : Attribut de fiche Add control for element (choice) and allow to use VALUE(1, 1), (2, 2),
dwm <=
- [Noalyss-commit] [noalyss] 26/33: PRINTJRN Cosmetic : 2 columns reversed, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 27/33: SQL : menu cosmetic, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 12/33: Menu not printable, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 14/33: PHP8.2 Allow Dynamic Properties, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 13/33: PRINTTVA : display tva_code, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 30/33: ODS : duplicate in currency, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 11/33: PHP8.2 Allow Dynamic Properties, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 25/33: Block new operation with deactivated card, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 15/33: Menu not printable, dwm, 2024/07/18