From 5f94ba1ec63d0c691e5b0cc9c4f075d590421fe5 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 7 Jun 2020 19:12:21 +0200 Subject: [PATCH 01/18] Error with card --- html/js/card.js | 2 +- include/ajax/ajax_card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html/js/card.js b/html/js/card.js index 1ad8e4e60..8c7b918ad 100644 --- a/html/js/card.js +++ b/html/js/card.js @@ -1157,7 +1157,7 @@ function delete_card_id(p_fiche_id) * update a card in ajax , and update a row * */ -function update_row(obj) +function card_update_row(obj) { try { var name = obj.id; diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php index 2053f1a83..11c6e7044 100644 --- a/include/ajax/ajax_card.php +++ b/include/ajax/ajax_card.php @@ -149,7 +149,7 @@ case 'dc': break; case "2": // update a row in the table X - $after_save="update_row(this)"; + $after_save="card_update_row(this)"; break; default: break; From ad67d7a8fd18e85b6a974045692c5a5d8ffe0dfc Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 9 Jun 2020 18:14:49 +0200 Subject: [PATCH 02/18] warning about undefined $this->f_id_dest --- include/class/follow_up.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/class/follow_up.class.php b/include/class/follow_up.class.php index 3f9327142..29164ce8d 100644 --- a/include/class/follow_up.class.php +++ b/include/class/follow_up.class.php @@ -104,6 +104,7 @@ class Follow_Up $this->aAction_detail=array(); $this->operation=""; $this->action=""; + $this->f_dest_id=0; } /** * Create a filter based on the current user, From 09659f756d58dfe89b8a1322c8de924cec15947c Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 10 Jun 2020 10:37:30 +0200 Subject: [PATCH 03/18] Cosmetic : disconnect --- html/recherche.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/html/recherche.php b/html/recherche.php index b2ebdba50..f9f47c17e 100644 --- a/html/recherche.php +++ b/html/recherche.php @@ -28,6 +28,11 @@ require_once NOALYSS_INCLUDE.'/class/acc_ledger.class.php'; require_once NOALYSS_INCLUDE.'/class/acc_ledger_search.class.php'; require_once NOALYSS_INCLUDE.'/lib/icon_action.class.php'; require_once NOALYSS_INCLUDE.'/lib/http_input.class.php'; +if ( ! isset ($_SESSION['g_theme'])) +{ + echo "

"._('Vous êtes déconnecté')."

"; + die(); +} html_page_start($_SESSION['g_theme']); From 376aab00b2b490dec471bac65f72a051dc89e16f Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 10 Jun 2020 10:45:43 +0200 Subject: [PATCH 04/18] Code : not direct access to $_GET Bug : javascript didn't work --- html/recherche.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/html/recherche.php b/html/recherche.php index f9f47c17e..f34549a23 100644 --- a/html/recherche.php +++ b/html/recherche.php @@ -74,7 +74,7 @@ window.onload=function () { create_anchor_up(); init_scroll(); - sorttable.init + sorttable.init(); } $v) - $r.=HtmlInput::hidden('r_jrn['.$k.']',$v); + $http=new HttpInput(); + $a_rjrn=$http->get("r_jrn","array"); + foreach ($a_rjrn as $k=>$v) { + // Protect : check that $k and $v are numeric + if (isNumber($k)&&isNumber($v)) { + $r.=HtmlInput::hidden('r_jrn['.$k.']',$v); + } + } } echo '
'; echo $r; From 270143694ec8e8a35f470330fca04a08a52e0054 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 15 Jun 2020 20:46:19 +0200 Subject: [PATCH 05/18] Bug : compatibility PHP7.4 --- include/tfpdf/tfpdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/tfpdf/tfpdf.php b/include/tfpdf/tfpdf.php index f9fb17971..6000a9fb2 100644 --- a/include/tfpdf/tfpdf.php +++ b/include/tfpdf/tfpdf.php @@ -1257,7 +1257,7 @@ function _dochecks() if(ini_get('mbstring.func_overload') & 2) $this->Error('mbstring overloading must be disabled'); // Ensure runtime magic quotes are disabled - if(get_magic_quotes_runtime()) + if(version_compare(PHP_VERSION, '7.3.0','<') && get_magic_quotes_runtime()) @set_magic_quotes_runtime(0); } From 8e85b9183e68dbbf9ba796b7d2fcb7e591e30252 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 18 Jun 2020 09:55:01 +0200 Subject: [PATCH 06/18] Cosmetic #1808 : Ma au lieu de Me dans le calendrier --- html/js/lang/calendar-fr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/js/lang/calendar-fr.js b/html/js/lang/calendar-fr.js index 1bfdc94a8..e2ee53d0f 100644 --- a/html/js/lang/calendar-fr.js +++ b/html/js/lang/calendar-fr.js @@ -39,7 +39,7 @@ Calendar._SDN = new Array ("Dim", "Lun", "Mar", - "Mar", + "Mer", "Jeu", "Ven", "Sam", From e3eac1da25860209865b9cefbf148de6cf05ad6d Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 18 Jun 2020 22:21:08 +0200 Subject: [PATCH 07/18] update config.inc.example file --- include/config.inc.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/config.inc.example b/include/config.inc.example index d3024056c..65650be22 100644 --- a/include/config.inc.example +++ b/include/config.inc.example @@ -13,6 +13,8 @@ define ("noalyss_psql_host","localhost"); // If you change the NOALYSS_ADMINISTRATOR , you will need to rerun http://..../noalyss/html/install.php // But it doesn't change the password define ("NOALYSS_ADMINISTRATOR","admin"); +// used only for install +define ("NOALYSS_ADMIN_PASSWORD",""); define ("LOCALE",1); define ("domaine",""); define ("MULTI",1); From b87be9761c3da720a4179360175d0fc5960d6b53 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 24 Jun 2020 13:04:17 +0200 Subject: [PATCH 08/18] Orthographe --- include/lib/message_javascript.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/lib/message_javascript.php b/include/lib/message_javascript.php index 6e54ab8d8..e9b9d1ebf 100644 --- a/include/lib/message_javascript.php +++ b/include/lib/message_javascript.php @@ -74,8 +74,8 @@ content[40]=" à zéro pour effacer la ligne"))?>"; content[42]=""; content[43]=""; -content[44]=""; -content[45]=""; +content[44]=""; +content[45]=""; content[46]=""; content[47]=""; content[48]=""; @@ -107,4 +107,4 @@ content[73]=""; content[75]=""; content[76]=""; - \ No newline at end of file + From af039f15583f6bd0be4f5834e9696c1e4c29ac44 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 24 Jun 2020 13:07:13 +0200 Subject: [PATCH 09/18] Ergonomie : autoliquidation --- include/class/tva_rate_mtable.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/class/tva_rate_mtable.class.php b/include/class/tva_rate_mtable.class.php index 403f513ab..460d7e857 100644 --- a/include/class/tva_rate_mtable.class.php +++ b/include/class/tva_rate_mtable.class.php @@ -53,8 +53,8 @@ class Tva_Rate_MTable extends Manage_Table_SQL $this->set_col_label("tva_purchase", _("TVA Achat (D)")); $this->set_col_type("tva_both_side", "select", array( - ["value"=>0, "label"=>_("Normal")], - ["value"=>1, "label"=>_("Autoliquidation")] + ["value"=>0, "label"=>_("Non")], + ["value"=>1, "label"=>_("Oui")] )); $this->set_property_updatable("tva_id", FALSE); $this->set_col_label("tva_payment_purchase",_("Exigible achat")); From 042e8753953311d1e8d8183609a78a77eb447d4f Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 30 Jun 2020 14:04:16 +0200 Subject: [PATCH 10/18] Bug : extourne ne fonctionne plus --- html/js/acc_ledger.js | 1 - 1 file changed, 1 deletion(-) diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js index 200a30651..8be1fa5e6 100644 --- a/html/js/acc_ledger.js +++ b/html/js/acc_ledger.js @@ -875,7 +875,6 @@ function reverseOperation(obj) { var qs = $(obj).serialize()+ "&op=ledger"; g('ext' + obj.divname).style.display = 'none'; - g('bext' + obj.divname).style.display = 'none'; waiting_box(); new Ajax.Request( "ajax_misc.php", From 50cbd096b1dd37e6daa4f11f0d84362c2804cc94 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 30 Jun 2020 18:27:45 +0200 Subject: [PATCH 11/18] Fix Bug : when duplicating an ODS operation, the accounting is cleared if a card is used --- include/class/acc_operation.class.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/include/class/acc_operation.class.php b/include/class/acc_operation.class.php index 8586607fd..7639d9d26 100644 --- a/include/class/acc_operation.class.php +++ b/include/class/acc_operation.class.php @@ -594,8 +594,8 @@ class Acc_Operation $ret=new Acc_Fin($this->db,$this->jr_id); break; default: - $ret=new Acc_Misc($this->db,$this->jr_id); - break; + $ret=new Acc_Misc($this->db,$this->jr_id); + break; } $ret->get(); if ( empty($ret->det->array)) @@ -776,9 +776,20 @@ class Acc_Operation } $r.="

"; - $r.=HtmlInput::simple_array_to_hidden($array); - // + // For Misc Operation , if a card is given then there is no accounting + if ( $operation->signature==="ODS") { + $nb_array=count($array); + for ($i=0;$i<$nb_array;$i++) { + if (isset ($array["qc_".$i] ) && $array["qc_".$i] != "" ) { + $array["poste".$i]=""; + } + } + } + + // transform the operation into hidden element + $r.=HtmlInput::simple_array_to_hidden($array); + $r.=HtmlInput::submit(uniqid(), _("Dupliquer")); $r.=''; From 066d08fbfa9cfd14e6db0175e11a026d781c527b Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 30 Jun 2020 18:28:54 +0200 Subject: [PATCH 12/18] Fix bug SQL check if a periode is closed returned wrong value --- sql/upgrade.sql | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/sql/upgrade.sql b/sql/upgrade.sql index e69de29bb..fb36c0d2a 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -0,0 +1,44 @@ +CREATE OR REPLACE FUNCTION comptaproc.jrn_check_periode() + RETURNS trigger + LANGUAGE plpgsql +AS $function$ +declare +bClosed bool; +str_status text; +ljr_tech_per jrn.jr_tech_per%TYPE; +ljr_def_id jrn.jr_def_id%TYPE; +lreturn jrn%ROWTYPE; +begin +if TG_OP='UPDATE' then + ljr_tech_per :=OLD.jr_tech_per ; + NEW.jr_tech_per := comptaproc.find_periode(to_char(NEW.jr_date,'DD.MM.YYYY')); + ljr_def_id :=OLD.jr_def_id; + lreturn :=NEW; + if NEW.jr_date = OLD.jr_date then + return NEW; + end if; + if comptaproc.is_closed(NEW.jr_tech_per,NEW.jr_def_id) = true then + raise exception 'Periode fermee'; + end if; +end if; + +if TG_OP='INSERT' then + NEW.jr_tech_per := comptaproc.find_periode(to_char(NEW.jr_date,'DD.MM.YYYY')); + ljr_tech_per :=NEW.jr_tech_per ; + ljr_def_id :=NEW.jr_def_id; + lreturn :=NEW; +end if; + +if TG_OP='DELETE' then + ljr_tech_per :=OLD.jr_tech_per; + ljr_def_id :=OLD.jr_def_id; + lreturn :=OLD; +end if; + +if comptaproc.is_closed (ljr_tech_per,ljr_def_id) = true then + raise exception 'Periode fermee'; +end if; + +return lreturn; +end;$function$ +; \ No newline at end of file From b025f0075f71efcbc0a0ce356acfabb414d71eba Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 1 Jul 2020 00:24:05 +0200 Subject: [PATCH 13/18] Improve error log --- include/action.common.inc.php | 4 ++-- include/ajax/ajax_card.php | 2 +- include/ajax/ajax_display_letter.php | 2 +- include/ajax/ajax_ledger.php | 8 ++++---- include/ajax/ajax_periode.php | 2 +- include/ajax/ajax_tva_parameter.php | 2 +- include/anc_key.inc.php | 2 +- include/card_attr.inc.php | 2 +- include/cfgledger.inc.php | 8 ++++---- include/class/acc_bilan.class.php | 2 +- include/class/acc_ledger.class.php | 12 ++++++------ include/class/acc_ledger_fin.class.php | 2 +- include/class/acc_ledger_info.class.php | 4 ++-- include/class/acc_ledger_purchase.class.php | 4 ++-- include/class/acc_ledger_sold.class.php | 2 +- include/class/acc_report.class.php | 4 ++-- include/class/anc_group_operation.class.php | 4 ++-- include/class/anc_key.class.php | 2 +- include/class/anc_operation.class.php | 2 +- include/class/default_menu.class.php | 2 +- include/class/document_modele.class.php | 4 ++-- include/class/document_type.class.php | 6 +++--- include/class/dossier.class.php | 2 +- include/class/fiche.class.php | 4 ++-- include/class/fiche_attr.class.php | 6 +++--- include/class/periode.class.php | 4 ++-- include/class/pre_op_ach.class.php | 2 +- include/class/pre_op_advanced.class.php | 2 +- include/class/pre_op_fin.class.php | 2 +- include/class/pre_op_ods.class.php | 2 +- include/class/pre_op_ven.class.php | 2 +- 31 files changed, 54 insertions(+), 54 deletions(-) diff --git a/include/action.common.inc.php b/include/action.common.inc.php index eb6ff979b..c60f13ab3 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -149,7 +149,7 @@ if ($sub_action == "update") $act->get(); $act->fromArray($_POST); $error_id=$e->getCode(); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; } } //---------------------------------------------------------------------- @@ -296,7 +296,7 @@ if ($sub_action == "save_action_st2") echo ''; $sub_action="add_action"; $error_id=$e->getCode(); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; } } //-------------------------------------------------------------------------------- diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php index 11c6e7044..628acb640 100644 --- a/include/ajax/ajax_card.php +++ b/include/ajax/ajax_card.php @@ -118,7 +118,7 @@ case 'rmfa': { $cn->rollback(); record_log($e->getMessage()); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo $e->getMessage(); } $html=ob_get_contents(); diff --git a/include/ajax/ajax_display_letter.php b/include/ajax/ajax_display_letter.php index 7e8f8007c..9a90996c0 100644 --- a/include/ajax/ajax_display_letter.php +++ b/include/ajax/ajax_display_letter.php @@ -38,7 +38,7 @@ try { }catch (Exception $e ) { record_log($e->getMessage()); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; return; } diff --git a/include/ajax/ajax_ledger.php b/include/ajax/ajax_ledger.php index 7f93ea81f..29b797a78 100644 --- a/include/ajax/ajax_ledger.php +++ b/include/ajax/ajax_ledger.php @@ -161,7 +161,7 @@ case 'rmop': } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $e->getMessage(); $cn->rollback(); } @@ -207,7 +207,7 @@ case 'de': } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo Icon_Action::close($div); echo '

'._("Désolé il y a une erreur").'

'; } @@ -512,7 +512,7 @@ case 'save': } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; if ( DEBUG ) echo $e->getMessage(); alert(_( "Changement impossible: on ne peut pas changer la date dans une période fermée")); } @@ -570,7 +570,7 @@ case 'reverseop': } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo $e->getMessage(); $cn->rollback(); } diff --git a/include/ajax/ajax_periode.php b/include/ajax/ajax_periode.php index 367546ef2..5ef93d85b 100644 --- a/include/ajax/ajax_periode.php +++ b/include/ajax/ajax_periode.php @@ -205,7 +205,7 @@ switch ($act) } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $html=$e->getTrace(); throw $e; } diff --git a/include/ajax/ajax_tva_parameter.php b/include/ajax/ajax_tva_parameter.php index cf2107aa0..0e92bbc02 100644 --- a/include/ajax/ajax_tva_parameter.php +++ b/include/ajax/ajax_tva_parameter.php @@ -42,7 +42,7 @@ try } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; return; } diff --git a/include/anc_key.inc.php b/include/anc_key.inc.php index a2b343f43..da0ab116f 100644 --- a/include/anc_key.inc.php +++ b/include/anc_key.inc.php @@ -56,7 +56,7 @@ switch ($op) } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo span($e->getMessage(), ' class="notice"'); Anc_Key::display_list(); Anc_Key::key_add(); diff --git a/include/card_attr.inc.php b/include/card_attr.inc.php index 88e3d9a9b..d0fa1fbab 100644 --- a/include/card_attr.inc.php +++ b/include/card_attr.inc.php @@ -56,7 +56,7 @@ if ( isset($_POST['save'])) } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; alert($e->getMessage()); $cn->rollback(); } diff --git a/include/cfgledger.inc.php b/include/cfgledger.inc.php index 679827d06..56561e503 100644 --- a/include/cfgledger.inc.php +++ b/include/cfgledger.inc.php @@ -62,7 +62,7 @@ if ( $action_frm == 'update') } catch (Exception $e) { record_log($e->getMessage()); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; alert($e->getMessage()); } } @@ -88,7 +88,7 @@ if ($action_frm == 'delete' ) catch (Exception $e) { record_log($e->getMessage()); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; alert ($e->getMessage()); } @@ -111,7 +111,7 @@ if (isset($_POST['add'])) catch (Exception $e) { record_log($e->getMessage()); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; alert($e->getMessage()); } } @@ -146,7 +146,7 @@ switch ($sa) catch (Exception $e) { record_log($e->getMessage()); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; alert($e->getMessage()); } break; diff --git a/include/class/acc_bilan.class.php b/include/class/acc_bilan.class.php index 398a3eb81..a7f81cfc1 100644 --- a/include/class/acc_bilan.class.php +++ b/include/class/acc_bilan.class.php @@ -284,7 +284,7 @@ class Acc_Bilan } catch(Exception $Ex) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo $Ex->getMessage(); throw $Ex; } diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index d43dcd933..e1c85d3ce 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -373,7 +373,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $this->db->rollback(); throw $e; } @@ -834,7 +834,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; if ($e->getCode()==1) { echo _("Aucune période ouverte"); @@ -1357,7 +1357,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $this->db->rollback(); echo _('OPERATION ANNULEE '); echo '
'; @@ -2134,7 +2134,7 @@ class Acc_Ledger extends jrn_def_sql catch (Exception $e) { $cn->rollback(); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; } $cn->commit(); } @@ -2385,7 +2385,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; throw $e; } } @@ -2642,7 +2642,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; throw $e; } } diff --git a/include/class/acc_ledger_fin.class.php b/include/class/acc_ledger_fin.class.php index 6392d8602..22ff0f0c1 100644 --- a/include/class/acc_ledger_fin.class.php +++ b/include/class/acc_ledger_fin.class.php @@ -1003,7 +1003,7 @@ class Acc_Ledger_Fin extends Acc_Ledger __FILE__ . ':' . __LINE__ . ' ' . $e->getMessage(); $this->db->rollback(); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; throw new Exception($r); } $this->db->commit(); diff --git a/include/class/acc_ledger_info.class.php b/include/class/acc_ledger_info.class.php index 44efb7fb2..137d67290 100644 --- a/include/class/acc_ledger_info.class.php +++ b/include/class/acc_ledger_info.class.php @@ -63,7 +63,7 @@ class Acc_Ledger_Info } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo "Echec sauvegarde info additionnelles"; throw $e; } @@ -86,7 +86,7 @@ class Acc_Ledger_Info } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $this->cn->rollback(); echo "Echec sauvegarde info additionnelles"; throw $e; diff --git a/include/class/acc_ledger_purchase.class.php b/include/class/acc_ledger_purchase.class.php index 4365cfdc3..523cd59c8 100644 --- a/include/class/acc_ledger_purchase.class.php +++ b/include/class/acc_ledger_purchase.class.php @@ -944,7 +944,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger }//end try catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo ''. 'Erreur dans l\'enregistrement '. __FILE__.':'.__LINE__.' '. @@ -1051,7 +1051,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; if ($e->getCode() == 1 ) { throw new Exception( _("Aucune période ouverte")); diff --git a/include/class/acc_ledger_sold.class.php b/include/class/acc_ledger_sold.class.php index 1979e7522..50cfbb49a 100644 --- a/include/class/acc_ledger_sold.class.php +++ b/include/class/acc_ledger_sold.class.php @@ -607,7 +607,7 @@ class Acc_Ledger_Sold extends Acc_Ledger { } } } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo '' . 'Erreur dans l\'enregistrement ' . __FILE__ . ':' . __LINE__ . ' ' . diff --git a/include/class/acc_report.class.php b/include/class/acc_report.class.php index 0c15e17ce..d08753521 100644 --- a/include/class/acc_report.class.php +++ b/include/class/acc_report.class.php @@ -216,7 +216,7 @@ class Acc_Report } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $this->db->rollback(); echo $e->getMessage(); } @@ -258,7 +258,7 @@ class Acc_Report } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $this->db->rollback(); echo $e->getMessage(); } diff --git a/include/class/anc_group_operation.class.php b/include/class/anc_group_operation.class.php index c5e45061d..991998822 100644 --- a/include/class/anc_group_operation.class.php +++ b/include/class/anc_group_operation.class.php @@ -74,7 +74,7 @@ class Anc_Group_Operation } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo $e->getTrace(); $this->db->rollback(); throw new Exception($e); @@ -260,7 +260,7 @@ class Anc_Group_Operation } catch (Exception $ex) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo ''. 'Erreur dans l\'enregistrement '. __FILE__.':'.__LINE__.' '. diff --git a/include/class/anc_key.class.php b/include/class/anc_key.class.php index ed06eb074..2ad6340f1 100644 --- a/include/class/anc_key.class.php +++ b/include/class/anc_key.class.php @@ -268,7 +268,7 @@ class Anc_Key { if ( DEBUG ) { echo $e->getTraceAsString(); } else { echo _('erreur').$e->getMessage();} - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $cn->rollback(); } } diff --git a/include/class/anc_operation.class.php b/include/class/anc_operation.class.php index d6f7b59f9..672f393e2 100644 --- a/include/class/anc_operation.class.php +++ b/include/class/anc_operation.class.php @@ -491,7 +491,7 @@ class Anc_Operation } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; } } /*!\brief display the form for PA diff --git a/include/class/default_menu.class.php b/include/class/default_menu.class.php index acb85207f..8b973d62e 100644 --- a/include/class/default_menu.class.php +++ b/include/class/default_menu.class.php @@ -106,7 +106,7 @@ class Default_Menu } } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo $e->getMessage(); throw $e; } diff --git a/include/class/document_modele.class.php b/include/class/document_modele.class.php index 7c29a8333..af8d254c4 100644 --- a/include/class/document_modele.class.php +++ b/include/class/document_modele.class.php @@ -194,7 +194,7 @@ class Document_modele } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; rollback($this->cn); return ; } @@ -360,7 +360,7 @@ class Document_modele } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; rollback($this->cn); return ; } diff --git a/include/class/document_type.class.php b/include/class/document_type.class.php index 92ffc823b..74ebafdaf 100644 --- a/include/class/document_type.class.php +++ b/include/class/document_type.class.php @@ -103,7 +103,7 @@ class Document_type } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; alert(j(_("Impossible d'ajouter [$p_value] ") . $e->getMessage())); } } @@ -120,7 +120,7 @@ class Document_type } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; alert(" Erreur " . $e->getMessage()); } } @@ -133,7 +133,7 @@ class Document_type } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; alert("Erreur " . $e->getMessage()); } } diff --git a/include/class/dossier.class.php b/include/class/dossier.class.php index ecd439e1a..51ea7f03f 100644 --- a/include/class/dossier.class.php +++ b/include/class/dossier.class.php @@ -326,7 +326,7 @@ class Dossier { echo_warning($e->getMessage()); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $cn->rollback(); } } diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php index 50bb3fb25..999b50271 100644 --- a/include/class/fiche.class.php +++ b/include/class/fiche.class.php @@ -925,7 +925,7 @@ class Fiche } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString()); $this->cn->rollback(); throw ($e); return; @@ -1117,7 +1117,7 @@ class Fiche $e->getMessage(). ''; record_log($e->getMessage()); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $this->cn->rollback(); return; } diff --git a/include/class/fiche_attr.class.php b/include/class/fiche_attr.class.php index 98cea2e90..5ddb70971 100644 --- a/include/class/fiche_attr.class.php +++ b/include/class/fiche_attr.class.php @@ -99,7 +99,7 @@ class Fiche_Attr $this->cn->exec_sql($this->ad_extra); }catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; throw new Exception ("La requête SQL ".h($this->ad_extra)." est invalide "); } } @@ -161,7 +161,7 @@ class Fiche_Attr ); } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; throw $e; } @@ -185,7 +185,7 @@ class Fiche_Attr ); }catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; throw $e; } diff --git a/include/class/periode.class.php b/include/class/periode.class.php index 16ca96d80..7cca1f516 100644 --- a/include/class/periode.class.php +++ b/include/class/periode.class.php @@ -273,7 +273,7 @@ class Periode catch (Exception $e) { record_log($e->getMessage()." - ".$e->getCode()); - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $this->cn->rollback(); throw $e; } @@ -495,7 +495,7 @@ class Periode } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; $this->cn->rollback(); throw $e; } diff --git a/include/class/pre_op_ach.class.php b/include/class/pre_op_ach.class.php index fb9640e77..7caa7668d 100644 --- a/include/class/pre_op_ach.class.php +++ b/include/class/pre_op_ach.class.php @@ -104,7 +104,7 @@ class Pre_op_ach extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/pre_op_advanced.class.php b/include/class/pre_op_advanced.class.php index 2c110fe45..51ba703e5 100644 --- a/include/class/pre_op_advanced.class.php +++ b/include/class/pre_op_advanced.class.php @@ -98,7 +98,7 @@ class Pre_Op_Advanced extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/pre_op_fin.class.php b/include/class/pre_op_fin.class.php index f293eb253..e443605ef 100644 --- a/include/class/pre_op_fin.class.php +++ b/include/class/pre_op_fin.class.php @@ -86,7 +86,7 @@ class Pre_op_fin extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/pre_op_ods.class.php b/include/class/pre_op_ods.class.php index d886768aa..dc30e34f6 100644 --- a/include/class/pre_op_ods.class.php +++ b/include/class/pre_op_ods.class.php @@ -78,7 +78,7 @@ class Pre_op_ods extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/pre_op_ven.class.php b/include/class/pre_op_ven.class.php index c76252c1b..2ffe031cd 100644 --- a/include/class/pre_op_ven.class.php +++ b/include/class/pre_op_ven.class.php @@ -102,7 +102,7 @@ class Pre_op_ven extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getTraceAsString()); + record_log($e->getMessage()." ".$e->getTraceAsString());; echo ($e->getMessage()); $this->db->rollback(); } From 6274b5eef69118a3048df54f6d27a4924f34ba69 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 10 Jul 2020 18:52:27 +0200 Subject: [PATCH 14/18] =?UTF-8?q?Task=20#0001813:=20CA=20=E2=80=93=20avert?= =?UTF-8?q?issement=20utilisation=20poste=20Info=20nombre=20d'utilisation?= =?UTF-8?q?=20Avoid=20delete=20on=20closed=20periode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/class/anc_account_table.class.php | 34 ++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/include/class/anc_account_table.class.php b/include/class/anc_account_table.class.php index d92b0f909..08ad0c393 100644 --- a/include/class/anc_account_table.class.php +++ b/include/class/anc_account_table.class.php @@ -74,7 +74,7 @@ class Anc_Account_Table extends Manage_Table_SQL $table->po_name=str_replace(">", '', $table->po_name); // po_name must be uniq in the Analytic Plan - if ( $cn->get_value("select count(*) from poste_analytique where pa_id=$1 and po_name=$2 and po_id != $3", + if ( $cn->get_value("select count(*) from poste_analytique where pa_id=$1 and po_name=upper($2) and po_id != $3", array($table->pa_id,$table->po_name,$table->po_id)) > 0) { $is_error++; @@ -90,4 +90,36 @@ class Anc_Account_Table extends Manage_Table_SQL if ($is_error==0)return TRUE; return FALSE; } + + /** + * @brief display a data row in the table, with the order defined + * in a_order and depending of the visibility of the column + */ + function display_row($p_row) + { + $cn=Dossier::connect(); + $count=$cn->get_value("select count(*) from public.operation_analytique where po_id=$1",[$p_row["po_id"]]); + $p_row["po_name"]=sprintf("%s (%d)",$p_row['po_name'],$count); + parent::display_row($p_row); + } + + /** + * Before deleting , we check that nothing is in a closed periode + */ + function delete() { + $cn=Dossier::connect(); + $count_closed=$cn->get_value(" select count(*) + from jrnx as jx1 + join jrn jn1 on (jx1.j_grpt = jn1.jr_grpt_id ) + join jrn_def as jf1 on (jn1.jr_def_id =jf1.jrn_def_id ) + join jrn_periode as je1 on (jf1.jrn_def_id =je1.jrn_def_id ) + join operation_analytique as oa on (oa.j_id =jx1.j_id ) + where + je1.status = 'CL' and oa.po_id=$1 ",[$this->table->po_id]); + if ( $count_closed > 0 ) { + throw new \Exception(_("Effacement impossible : le poste est utilisé dans une période fermée")); + } + + } + } From 14feb06f6245d91c45be792423a4bfd4f4acb055 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 11 Jul 2020 18:55:39 +0200 Subject: [PATCH 15/18] CC Cosmetic --- html/calendar-blue.css | 4 ++-- html/style-classic7.css | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/html/calendar-blue.css b/html/calendar-blue.css index c7bb87f08..b403b9f6b 100644 --- a/html/calendar-blue.css +++ b/html/calendar-blue.css @@ -19,8 +19,8 @@ div.calendar { position: relative; z-index:13; } border-radius: 0px; } -.calendar .nav { - background: #778 url(menuarrow.gif) no-repeat 100% 100%; +.calendar .nav1 { + #background: #778 url(menuarrow.gif) no-repeat 100% 100%; } .calendar thead .title { /* This holds the current "month, year" */ diff --git a/html/style-classic7.css b/html/style-classic7.css index 3ffb83c97..866f4d34a 100644 --- a/html/style-classic7.css +++ b/html/style-classic7.css @@ -1538,6 +1538,7 @@ div.box { float:left; font-size:14px; font-size:0.90rem; + border-radius:5px; } @media only screen and (max-width: 1426px) { div.box { @@ -2467,4 +2468,4 @@ span.title_tab_row { background-color: #000066 !important; color : white !important; -} \ No newline at end of file +} From 6906f48e55b3517fecf70d45ed908c3c44413a12 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 11 Jul 2020 18:56:08 +0200 Subject: [PATCH 16/18] Javascript object before --- include/anc_pa.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/anc_pa.inc.php b/include/anc_pa.inc.php index f3fc67433..f16170804 100644 --- a/include/anc_pa.inc.php +++ b/include/anc_pa.inc.php @@ -145,8 +145,8 @@ if ($sa=="pa_detail") $accounting->add_json_param("pa_id", $pa_id); $accounting->set_sort_column("po_name"); ob_start(); - $accounting->display_table(" where pa_id = $1 order by po_name ",array($pa_id)); $accounting->create_js_script(); + $accounting->display_table(" where pa_id = $1 order by po_name ",array($pa_id)); $ret.=ob_get_clean(); $ret.= ''; } From 800b4139adcd3263560b441a7782fd93d5da0451 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 11 Jul 2020 18:56:37 +0200 Subject: [PATCH 17/18] Improve : logging error --- include/action.common.inc.php | 4 ++-- include/ajax/ajax_card.php | 2 +- include/ajax/ajax_display_letter.php | 2 +- include/ajax/ajax_ledger.php | 8 ++++---- include/ajax/ajax_periode.php | 2 +- include/ajax/ajax_tva_parameter.php | 2 +- include/anc_key.inc.php | 2 +- include/card_attr.inc.php | 2 +- include/cfgledger.inc.php | 8 ++++---- include/class/acc_bilan.class.php | 2 +- include/class/acc_ledger.class.php | 12 ++++++------ include/class/acc_ledger_fin.class.php | 2 +- include/class/acc_ledger_info.class.php | 4 ++-- include/class/acc_ledger_purchase.class.php | 4 ++-- include/class/acc_ledger_sold.class.php | 2 +- include/class/acc_report.class.php | 4 ++-- include/class/anc_group_operation.class.php | 4 ++-- include/class/anc_key.class.php | 2 +- include/class/anc_operation.class.php | 2 +- include/class/default_menu.class.php | 2 +- include/class/document_modele.class.php | 4 ++-- include/class/document_type.class.php | 6 +++--- include/class/dossier.class.php | 2 +- include/class/fiche.class.php | 2 +- include/class/fiche_attr.class.php | 6 +++--- include/class/periode.class.php | 4 ++-- include/class/pre_op_ach.class.php | 2 +- include/class/pre_op_advanced.class.php | 2 +- include/class/pre_op_fin.class.php | 2 +- include/class/pre_op_ods.class.php | 2 +- include/class/pre_op_ven.class.php | 2 +- include/lib/ac_common.php | 5 ++--- 32 files changed, 55 insertions(+), 56 deletions(-) diff --git a/include/action.common.inc.php b/include/action.common.inc.php index c60f13ab3..59d9041f3 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -149,7 +149,7 @@ if ($sub_action == "update") $act->get(); $act->fromArray($_POST); $error_id=$e->getCode(); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); } } //---------------------------------------------------------------------- @@ -296,7 +296,7 @@ if ($sub_action == "save_action_st2") echo ''; $sub_action="add_action"; $error_id=$e->getCode(); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); } } //-------------------------------------------------------------------------------- diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php index 628acb640..9b61631ba 100644 --- a/include/ajax/ajax_card.php +++ b/include/ajax/ajax_card.php @@ -118,7 +118,7 @@ case 'rmfa': { $cn->rollback(); record_log($e->getMessage()); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo $e->getMessage(); } $html=ob_get_contents(); diff --git a/include/ajax/ajax_display_letter.php b/include/ajax/ajax_display_letter.php index 9a90996c0..06f36e189 100644 --- a/include/ajax/ajax_display_letter.php +++ b/include/ajax/ajax_display_letter.php @@ -38,7 +38,7 @@ try { }catch (Exception $e ) { record_log($e->getMessage()); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); return; } diff --git a/include/ajax/ajax_ledger.php b/include/ajax/ajax_ledger.php index 29b797a78..316a5a662 100644 --- a/include/ajax/ajax_ledger.php +++ b/include/ajax/ajax_ledger.php @@ -161,7 +161,7 @@ case 'rmop': } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $e->getMessage(); $cn->rollback(); } @@ -207,7 +207,7 @@ case 'de': } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo Icon_Action::close($div); echo '

'._("Désolé il y a une erreur").'

'; } @@ -512,7 +512,7 @@ case 'save': } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); if ( DEBUG ) echo $e->getMessage(); alert(_( "Changement impossible: on ne peut pas changer la date dans une période fermée")); } @@ -570,7 +570,7 @@ case 'reverseop': } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo $e->getMessage(); $cn->rollback(); } diff --git a/include/ajax/ajax_periode.php b/include/ajax/ajax_periode.php index 5ef93d85b..e8e2cb133 100644 --- a/include/ajax/ajax_periode.php +++ b/include/ajax/ajax_periode.php @@ -205,7 +205,7 @@ switch ($act) } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $html=$e->getTrace(); throw $e; } diff --git a/include/ajax/ajax_tva_parameter.php b/include/ajax/ajax_tva_parameter.php index 0e92bbc02..8be4577bb 100644 --- a/include/ajax/ajax_tva_parameter.php +++ b/include/ajax/ajax_tva_parameter.php @@ -42,7 +42,7 @@ try } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); return; } diff --git a/include/anc_key.inc.php b/include/anc_key.inc.php index da0ab116f..7298ca5a5 100644 --- a/include/anc_key.inc.php +++ b/include/anc_key.inc.php @@ -56,7 +56,7 @@ switch ($op) } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo span($e->getMessage(), ' class="notice"'); Anc_Key::display_list(); Anc_Key::key_add(); diff --git a/include/card_attr.inc.php b/include/card_attr.inc.php index d0fa1fbab..fa8bcae8d 100644 --- a/include/card_attr.inc.php +++ b/include/card_attr.inc.php @@ -56,7 +56,7 @@ if ( isset($_POST['save'])) } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); alert($e->getMessage()); $cn->rollback(); } diff --git a/include/cfgledger.inc.php b/include/cfgledger.inc.php index 56561e503..7984d48b9 100644 --- a/include/cfgledger.inc.php +++ b/include/cfgledger.inc.php @@ -62,7 +62,7 @@ if ( $action_frm == 'update') } catch (Exception $e) { record_log($e->getMessage()); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); alert($e->getMessage()); } } @@ -88,7 +88,7 @@ if ($action_frm == 'delete' ) catch (Exception $e) { record_log($e->getMessage()); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); alert ($e->getMessage()); } @@ -111,7 +111,7 @@ if (isset($_POST['add'])) catch (Exception $e) { record_log($e->getMessage()); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); alert($e->getMessage()); } } @@ -146,7 +146,7 @@ switch ($sa) catch (Exception $e) { record_log($e->getMessage()); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); alert($e->getMessage()); } break; diff --git a/include/class/acc_bilan.class.php b/include/class/acc_bilan.class.php index a7f81cfc1..51b8b5fba 100644 --- a/include/class/acc_bilan.class.php +++ b/include/class/acc_bilan.class.php @@ -284,7 +284,7 @@ class Acc_Bilan } catch(Exception $Ex) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo $Ex->getMessage(); throw $Ex; } diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index e1c85d3ce..30df01e4d 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -373,7 +373,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $this->db->rollback(); throw $e; } @@ -834,7 +834,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); if ($e->getCode()==1) { echo _("Aucune période ouverte"); @@ -1357,7 +1357,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $this->db->rollback(); echo _('OPERATION ANNULEE '); echo '
'; @@ -2134,7 +2134,7 @@ class Acc_Ledger extends jrn_def_sql catch (Exception $e) { $cn->rollback(); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); } $cn->commit(); } @@ -2385,7 +2385,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); throw $e; } } @@ -2642,7 +2642,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); throw $e; } } diff --git a/include/class/acc_ledger_fin.class.php b/include/class/acc_ledger_fin.class.php index 22ff0f0c1..15c381211 100644 --- a/include/class/acc_ledger_fin.class.php +++ b/include/class/acc_ledger_fin.class.php @@ -1003,7 +1003,7 @@ class Acc_Ledger_Fin extends Acc_Ledger __FILE__ . ':' . __LINE__ . ' ' . $e->getMessage(); $this->db->rollback(); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); throw new Exception($r); } $this->db->commit(); diff --git a/include/class/acc_ledger_info.class.php b/include/class/acc_ledger_info.class.php index 137d67290..be9e9ea1d 100644 --- a/include/class/acc_ledger_info.class.php +++ b/include/class/acc_ledger_info.class.php @@ -63,7 +63,7 @@ class Acc_Ledger_Info } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo "Echec sauvegarde info additionnelles"; throw $e; } @@ -86,7 +86,7 @@ class Acc_Ledger_Info } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $this->cn->rollback(); echo "Echec sauvegarde info additionnelles"; throw $e; diff --git a/include/class/acc_ledger_purchase.class.php b/include/class/acc_ledger_purchase.class.php index 523cd59c8..d47336625 100644 --- a/include/class/acc_ledger_purchase.class.php +++ b/include/class/acc_ledger_purchase.class.php @@ -944,7 +944,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger }//end try catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo ''. 'Erreur dans l\'enregistrement '. __FILE__.':'.__LINE__.' '. @@ -1051,7 +1051,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); if ($e->getCode() == 1 ) { throw new Exception( _("Aucune période ouverte")); diff --git a/include/class/acc_ledger_sold.class.php b/include/class/acc_ledger_sold.class.php index 50cfbb49a..2704e47c5 100644 --- a/include/class/acc_ledger_sold.class.php +++ b/include/class/acc_ledger_sold.class.php @@ -607,7 +607,7 @@ class Acc_Ledger_Sold extends Acc_Ledger { } } } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo '' . 'Erreur dans l\'enregistrement ' . __FILE__ . ':' . __LINE__ . ' ' . diff --git a/include/class/acc_report.class.php b/include/class/acc_report.class.php index d08753521..952c40a37 100644 --- a/include/class/acc_report.class.php +++ b/include/class/acc_report.class.php @@ -216,7 +216,7 @@ class Acc_Report } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $this->db->rollback(); echo $e->getMessage(); } @@ -258,7 +258,7 @@ class Acc_Report } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $this->db->rollback(); echo $e->getMessage(); } diff --git a/include/class/anc_group_operation.class.php b/include/class/anc_group_operation.class.php index 991998822..b0058ef71 100644 --- a/include/class/anc_group_operation.class.php +++ b/include/class/anc_group_operation.class.php @@ -74,7 +74,7 @@ class Anc_Group_Operation } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo $e->getTrace(); $this->db->rollback(); throw new Exception($e); @@ -260,7 +260,7 @@ class Anc_Group_Operation } catch (Exception $ex) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo ''. 'Erreur dans l\'enregistrement '. __FILE__.':'.__LINE__.' '. diff --git a/include/class/anc_key.class.php b/include/class/anc_key.class.php index 2ad6340f1..4fec773ed 100644 --- a/include/class/anc_key.class.php +++ b/include/class/anc_key.class.php @@ -268,7 +268,7 @@ class Anc_Key { if ( DEBUG ) { echo $e->getTraceAsString(); } else { echo _('erreur').$e->getMessage();} - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $cn->rollback(); } } diff --git a/include/class/anc_operation.class.php b/include/class/anc_operation.class.php index 672f393e2..6e87cc9df 100644 --- a/include/class/anc_operation.class.php +++ b/include/class/anc_operation.class.php @@ -491,7 +491,7 @@ class Anc_Operation } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); } } /*!\brief display the form for PA diff --git a/include/class/default_menu.class.php b/include/class/default_menu.class.php index 8b973d62e..80a9de07d 100644 --- a/include/class/default_menu.class.php +++ b/include/class/default_menu.class.php @@ -106,7 +106,7 @@ class Default_Menu } } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo $e->getMessage(); throw $e; } diff --git a/include/class/document_modele.class.php b/include/class/document_modele.class.php index af8d254c4..a1722a9d2 100644 --- a/include/class/document_modele.class.php +++ b/include/class/document_modele.class.php @@ -194,7 +194,7 @@ class Document_modele } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); rollback($this->cn); return ; } @@ -360,7 +360,7 @@ class Document_modele } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); rollback($this->cn); return ; } diff --git a/include/class/document_type.class.php b/include/class/document_type.class.php index 74ebafdaf..8f0d2fbf1 100644 --- a/include/class/document_type.class.php +++ b/include/class/document_type.class.php @@ -103,7 +103,7 @@ class Document_type } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); alert(j(_("Impossible d'ajouter [$p_value] ") . $e->getMessage())); } } @@ -120,7 +120,7 @@ class Document_type } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); alert(" Erreur " . $e->getMessage()); } } @@ -133,7 +133,7 @@ class Document_type } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); alert("Erreur " . $e->getMessage()); } } diff --git a/include/class/dossier.class.php b/include/class/dossier.class.php index 51ea7f03f..1f62b042b 100644 --- a/include/class/dossier.class.php +++ b/include/class/dossier.class.php @@ -326,7 +326,7 @@ class Dossier { echo_warning($e->getMessage()); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $cn->rollback(); } } diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php index 999b50271..876351e36 100644 --- a/include/class/fiche.class.php +++ b/include/class/fiche.class.php @@ -1117,7 +1117,7 @@ class Fiche $e->getMessage(). ''; record_log($e->getMessage()); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $this->cn->rollback(); return; } diff --git a/include/class/fiche_attr.class.php b/include/class/fiche_attr.class.php index 5ddb70971..c764731e5 100644 --- a/include/class/fiche_attr.class.php +++ b/include/class/fiche_attr.class.php @@ -99,7 +99,7 @@ class Fiche_Attr $this->cn->exec_sql($this->ad_extra); }catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); throw new Exception ("La requête SQL ".h($this->ad_extra)." est invalide "); } } @@ -161,7 +161,7 @@ class Fiche_Attr ); } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); throw $e; } @@ -185,7 +185,7 @@ class Fiche_Attr ); }catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); throw $e; } diff --git a/include/class/periode.class.php b/include/class/periode.class.php index 7cca1f516..43cde5797 100644 --- a/include/class/periode.class.php +++ b/include/class/periode.class.php @@ -273,7 +273,7 @@ class Periode catch (Exception $e) { record_log($e->getMessage()." - ".$e->getCode()); - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $this->cn->rollback(); throw $e; } @@ -495,7 +495,7 @@ class Periode } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); $this->cn->rollback(); throw $e; } diff --git a/include/class/pre_op_ach.class.php b/include/class/pre_op_ach.class.php index 7caa7668d..722c9deed 100644 --- a/include/class/pre_op_ach.class.php +++ b/include/class/pre_op_ach.class.php @@ -104,7 +104,7 @@ class Pre_op_ach extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/pre_op_advanced.class.php b/include/class/pre_op_advanced.class.php index 51ba703e5..3d78bc9e7 100644 --- a/include/class/pre_op_advanced.class.php +++ b/include/class/pre_op_advanced.class.php @@ -98,7 +98,7 @@ class Pre_Op_Advanced extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/pre_op_fin.class.php b/include/class/pre_op_fin.class.php index e443605ef..ea16b0dbf 100644 --- a/include/class/pre_op_fin.class.php +++ b/include/class/pre_op_fin.class.php @@ -86,7 +86,7 @@ class Pre_op_fin extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/pre_op_ods.class.php b/include/class/pre_op_ods.class.php index dc30e34f6..1130e6208 100644 --- a/include/class/pre_op_ods.class.php +++ b/include/class/pre_op_ods.class.php @@ -78,7 +78,7 @@ class Pre_op_ods extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/pre_op_ven.class.php b/include/class/pre_op_ven.class.php index 2ffe031cd..3d97c0687 100644 --- a/include/class/pre_op_ven.class.php +++ b/include/class/pre_op_ven.class.php @@ -102,7 +102,7 @@ class Pre_op_ven extends Pre_operation_detail } catch (Exception $e) { - record_log($e->getMessage()." ".$e->getTraceAsString());; + record_log($e); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php index 39c65de90..44ee884ad 100644 --- a/include/lib/ac_common.php +++ b/include/lib/ac_common.php @@ -1331,9 +1331,8 @@ function is_msie() */ function record_log($p_message) { - error_log("noalyss".$p_message,0); - error_log("noalyss GET [".var_export($_GET, true)."]",0); - error_log( "noalyss POST [".var_export($_POST, true)."]",0); + error_log("noalyss".print_r($p_message,true),0); + error_log("noalyss GET [".var_export($_GET, true)."] POST [".var_export($_POST, true)."]",0); } if(!function_exists('tracedebug')) { function tracedebug($file,$var, $label = NULL) { From 3450d5f35054d2fffef56fe18fc3bf434406261a Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 11 Jul 2020 18:58:06 +0200 Subject: [PATCH 18/18] Error concat --- include/lib/manage_table_sql.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lib/manage_table_sql.class.php b/include/lib/manage_table_sql.class.php index 3488a20ea..cd364686b 100644 --- a/include/lib/manage_table_sql.class.php +++ b/include/lib/manage_table_sql.class.php @@ -1018,7 +1018,7 @@ function check() { $s1=$xml->createElement("status", "NOK"); $s2=$xml->createElement("ctl_row", - $this->object_name+"_"+$this->table->get_pk_value()); + $this->object_name."_".$this->table->get_pk_value()); $s4=$xml->createElement("ctl", $this->object_name); $s3=$xml->createElement("html", $ex->getTraceAsString()); $root=$xml->createElement("data"); @@ -1094,7 +1094,7 @@ function check() $s1=$xml->createElement("status", "NOK"); $s3=$xml->createElement("ctl", $this->object_name); $s2=$xml->createElement("ctl_row", - $this->object_name+"_"+$this->table->get_pk_value()); + $this->object_name."_".$this->table->get_pk_value()); $s4=$xml->createElement("html", $ex->getTraceAsString()); $root=$xml->createElement("data");