[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 01/34: Fix bug : new document w/o description
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 01/34: Fix bug : new document w/o description Change print_r by var_export Improve PHPUNIT |
Date: |
Sun, 5 Feb 2023 04:41:39 -0500 (EST) |
sparkyx pushed a commit to branch devel
in repository noalyss.
commit b3674eaa7bf070b95c449ff0977bddccebe72679
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Jan 8 20:22:37 2023 +0100
Fix bug : new document w/o description
Change print_r by var_export
Improve PHPUNIT
---
include/class/contact.class.php | 2 +-
include/lib/ac_common.php | 8 ++++----
include/lib/http_input.class.php | 2 +-
include/lib/manage_table_sql.class.php | 2 +-
include/template/follow_up-display.php | 11 +++++++++--
unit-test/bootstrap.php.example | 2 ++
6 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/include/class/contact.class.php b/include/class/contact.class.php
index efbce2378..ad85550fc 100644
--- a/include/class/contact.class.php
+++ b/include/class/contact.class.php
@@ -167,7 +167,7 @@ class contact extends Fiche
}
$ps_sql .= $limit ;
if (DEBUGNOALYSS > 1) {
- print_r("Contact::fetch ($ps_sql)");
+ var_export("Contact::fetch ($ps_sql)");
}
return $this->cn->get_array($ps_sql);
}
diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php
index ad7629754..a2659f714 100644
--- a/include/lib/ac_common.php
+++ b/include/lib/ac_common.php
@@ -1403,9 +1403,9 @@ function is_msie()
*/
function record_log($p_message)
{
- error_log("noalyss".print_r($p_message,true),0);
- error_log("noalyss GET [".json_encode($_GET)."]");
- error_log("_POST [".json_encode($_POST)."]",0);
+ error_log("noalyss".var_export($p_message,true),0);
+ error_log("noalyss GET [".json_encode($_GET,0,10)."]");
+ error_log("_POST [".json_encode($_POST,0,10)."]",0);
}
if(!function_exists('tracedebug')) {
function tracedebug($file,$var, $label = NULL) {
@@ -1685,4 +1685,4 @@ function linkTo($p_url)
} else {
return $p_url;
}
-}
\ No newline at end of file
+}
diff --git a/include/lib/http_input.class.php b/include/lib/http_input.class.php
index 56a3676c0..535573f4b 100644
--- a/include/lib/http_input.class.php
+++ b/include/lib/http_input.class.php
@@ -47,7 +47,7 @@ class HttpInput
}
public function __toString(): string
{
- return "http_input".print_r($this,true);
+ return "http_input".var_export($this,true);
}
public function get_array()
{
diff --git a/include/lib/manage_table_sql.class.php
b/include/lib/manage_table_sql.class.php
index 37c9f98f0..ba52307db 100644
--- a/include/lib/manage_table_sql.class.php
+++ b/include/lib/manage_table_sql.class.php
@@ -1530,7 +1530,7 @@ function check()
}
/**
- * @brief usually contain a link and calls another page, it must overriden
+ * @brief usually contain a link and calls another page, it must be
overriden
* @param array $p_row is the current database row
* @return void
*/
diff --git a/include/template/follow_up-display.php
b/include/template/follow_up-display.php
index f2230a7a9..807dbc2ed 100644
--- a/include/template/follow_up-display.php
+++ b/include/template/follow_up-display.php
@@ -308,8 +308,15 @@ function small(p_id_textarea){
echo '<div class="textarea"
style="margin-left:5%;margin-right:5%;margin-bottom:1rem;width:90%;">';
echo $description->input();
echo '</div>';
- } else {
- // no description and no comment
+ } elseif ( $p_view != 'READ' ) {
+ // no description and no comment it is a new document
+
+ echo h2(_("Description"));
+ $description->set_enrichText('enrich');
+ $description->style='style="height:250px;width:90%;"';
+ echo '<div class="textarea"
style="margin-left:5%;margin-right:5%;margin-bottom:1rem;width:90%;">';
+ echo $description->input();
+ echo '</div>';
}
diff --git a/unit-test/bootstrap.php.example b/unit-test/bootstrap.php.example
index c9dad86d8..68ba8c025 100644
--- a/unit-test/bootstrap.php.example
+++ b/unit-test/bootstrap.php.example
@@ -19,6 +19,8 @@
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu
+define ('NOALYSS_URL','PHPUNIT');
+define ('DIRTEST',__DIR__);
/**
* constant.php contains a autoloader for classes
- [Noalyss-commit] [noalyss] branch devel updated (4b0ee7b0e -> 1ba959b43), Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 04/34: NEW #0002205 Mode maintenance, Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 07/34: Improve security : replace $_POST by Http_Input, Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 01/34: Fix bug : new document w/o description Change print_r by var_export Improve PHPUNIT,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 03/34: Bug : default accounting override existing one, Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 10/34: Bug : default accounting override existing one, Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 13/34: Improve security : function isAdmin recheck the password, Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 17/34: Fix : if there is no stock there is an exception instead of a warning, Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 15/34: Fix : the select range select also the hidden element, Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 05/34: Fix : generate_random_string returns always same value , due to a change in srand(), Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 21/34: Cosmetic : improve CSS for enrich text, Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 26/34: Task #0002219: Compatibilit PHP 8.2, Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 28/34: Task #0002209: CG – Dans le menu d'actions sur une opération, remplacer «Effacer» par «Supprimer», Dany De Bontridder, 2023/02/05
- [Noalyss-commit] [noalyss] 09/34: Bug : default accounting override existing one, Dany De Bontridder, 2023/02/05