diff --git a/html/do.php b/html/do.php index b01ab8d3b..df7396bd7 100644 --- a/html/do.php +++ b/html/do.php @@ -255,7 +255,7 @@ if (isset($_REQUEST['ac'])) } else { alert($e->getMessage()); - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); } } } @@ -285,7 +285,7 @@ else catch (Exception $exc) { echo $exc->getMessage(); - error_log($exc->getTraceAsString()); + record_log($exc->getTraceAsString()); } } diff --git a/include/action.common.inc.php b/include/action.common.inc.php index 501a28992..71b46c280 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -150,6 +150,7 @@ if ($sub_action == "update") $act->get(); $act->fromArray($_POST); $error_id=$e->getCode(); + record_log($e->getTraceAsString()); } } //---------------------------------------------------------------------- @@ -289,6 +290,7 @@ if ($sub_action == "save_action_st2") echo ''; $sub_action="add_action"; $error_id=$e->getCode(); + record_log($e->getTraceAsString()); } } //-------------------------------------------------------------------------------- diff --git a/include/ajax/ajax_account_update.php b/include/ajax/ajax_account_update.php index bc6c3afc1..c18529d2f 100644 --- a/include/ajax/ajax_account_update.php +++ b/include/ajax/ajax_account_update.php @@ -77,6 +77,7 @@ if ($action=="update" &&$acc_delete==0) $message=_("Valeurs invalides, pas de changement")." \n ". $e->getMessage(); $ctl='nok'; + record_log($e->getTraceAsString()); } if (strlen($p_val)!=0&&strlen($p_lib)!=0&&strlen($old_line)!=0) { @@ -108,6 +109,7 @@ if ($action=="update" &&$acc_delete==0) { $message=$e->getMessage(); $ctl='nok'; + record_log($e->getTraceAsString()); } } } diff --git a/include/ajax/ajax_gestion.php b/include/ajax/ajax_gestion.php index f7eae9a46..56ae41f98 100644 --- a/include/ajax/ajax_gestion.php +++ b/include/ajax/ajax_gestion.php @@ -83,6 +83,7 @@ if ($op=='action_save') } catch (Exception $ex) { + record_log($ex->getTraceAsString()); header('Content-type: text/xml; charset=UTF-8'); $dom=new DOMDocument('1.0', 'UTF-8'); $xml_content=$dom->createElement('content', $ex->getMessage()); @@ -115,6 +116,7 @@ if ($op=='action_save') $gestion->save_short(); } catch (Exception $ex) { + record_log($ex->getTraceAsString()); $content=$ex->getMessage(); $status='NOK'; } diff --git a/include/ajax/ajax_ledger.php b/include/ajax/ajax_ledger.php index 2ce5c27bb..dba4bbacc 100644 --- a/include/ajax/ajax_ledger.php +++ b/include/ajax/ajax_ledger.php @@ -156,6 +156,7 @@ case 'rmop': } catch (Exception $e) { + record_log($e->getTraceAsString()); $e->getMessage(); $cn->rollback(); } @@ -201,6 +202,7 @@ case 'de': } catch (Exception $e) { + record_log($e->getTraceAsString()); echo HtmlInput::anchor_close($div); echo '

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

'; } @@ -504,6 +506,7 @@ case 'save': } catch (Exception $e) { + record_log($e->getTraceAsString()); if ( DEBUG ) echo $e->getMessage(); alert(_( "Changement impossible: on ne peut pas changer la date dans une période fermée")); } @@ -556,6 +559,7 @@ case 'reverseop': } catch (Exception $e) { + record_log($e->getTraceAsString()); $e->getMessage(); $cn->rollback(); } diff --git a/include/ajax/ajax_mod_periode.php b/include/ajax/ajax_mod_periode.php index b2d9f15a0..e07c70484 100644 --- a/include/ajax/ajax_mod_periode.php +++ b/include/ajax/ajax_mod_periode.php @@ -90,6 +90,7 @@ switch ($op) } catch (Exception $e) { + record_log($e->getTraceAsString()); $html = alert($e->getTrace(), true); } } diff --git a/include/anc_key.inc.php b/include/anc_key.inc.php index bb04c7a41..dfae97b6b 100644 --- a/include/anc_key.inc.php +++ b/include/anc_key.inc.php @@ -57,6 +57,7 @@ switch ($op) } catch (Exception $e) { + record_log($e->getTraceAsString()); echo span($e->getMessage(),' class="notice"'); } } diff --git a/include/card_attr.inc.php b/include/card_attr.inc.php index 6c182c12c..b394c7177 100644 --- a/include/card_attr.inc.php +++ b/include/card_attr.inc.php @@ -56,6 +56,7 @@ if ( isset($_POST['save'])) } catch (Exception $e) { + record_log($e->getTraceAsString()); alert($e->getMessage()); $cn->rollback(); } diff --git a/include/cfgledger.inc.php b/include/cfgledger.inc.php index d0a239c2c..fe574298f 100644 --- a/include/cfgledger.inc.php +++ b/include/cfgledger.inc.php @@ -54,6 +54,7 @@ if ( $action_frm == 'update') $show_menu=1; } catch (Exception $e) { + record_log($e->getTraceAsString()); alert($e->getMessage()); } } @@ -77,6 +78,7 @@ if ($action_frm == 'delete' ) } catch (Exception $e) { + record_log($e->getTraceAsString()); alert ($e->getMessage()); } @@ -97,6 +99,7 @@ if (isset($_POST['add'])) } catch (Exception $e) { + record_log($e->getTraceAsString()); alert($e->getMessage()); } } @@ -130,6 +133,7 @@ switch ($sa) } catch (Exception $e) { + record_log($e->getTraceAsString()); alert($e->getMessage()); } break; diff --git a/include/cfgplugin.inc.php b/include/cfgplugin.inc.php index c11d5992f..2af913b3d 100644 --- a/include/cfgplugin.inc.php +++ b/include/cfgplugin.inc.php @@ -82,6 +82,7 @@ if ( isset ($_POST['save_plugin'])){ } catch (Exception $exc) { + record_log($exc->getTraceAsString()); $profile_name=$cn->get_value('select profile.p_name from profile where p_id=$1' ,array($profile)); echo '

'; diff --git a/include/class/class_acc_bilan.php b/include/class/class_acc_bilan.php index 86a41bf73..f663cd665 100644 --- a/include/class/class_acc_bilan.php +++ b/include/class/class_acc_bilan.php @@ -278,6 +278,7 @@ class Acc_Bilan } catch(Exception $Ex) { + record_log($e->getTraceAsString()); echo $Ex->getMessage(); throw $Ex; } diff --git a/include/class/class_acc_ledger.php b/include/class/class_acc_ledger.php index 0788238c5..3fa0cdc39 100644 --- a/include/class/class_acc_ledger.php +++ b/include/class/class_acc_ledger.php @@ -334,6 +334,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { + record_log($e->getTraceAsString()); $this->db->rollback(); throw $e; } @@ -1651,6 +1652,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { + record_log($e->getTraceAsString()); if ($e->getCode() == 1) { echo _("Aucune période ouverte"); @@ -2150,12 +2152,10 @@ class Acc_Ledger extends jrn_def_sql } } - catch (Exception $a) - { - throw $a; - } + catch (Exception $e) { + record_log($e->getTraceAsString()); $this->db->rollback(); echo _('OPERATION ANNULEE '); echo '


'; @@ -3366,7 +3366,7 @@ class Acc_Ledger extends jrn_def_sql catch (Exception $e) { $cn->rollback(); - var_dump($e); + record_log($e->getTraceAsString()); } $cn->commit(); } @@ -3585,6 +3585,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { + record_log($e->getTraceAsString()); throw $e; } } @@ -3816,6 +3817,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { + record_log($e->getTraceAsString()); throw $e; } } diff --git a/include/class/class_acc_ledger_fin.php b/include/class/class_acc_ledger_fin.php index 05ad19bde..5b1e6cd40 100644 --- a/include/class/class_acc_ledger_fin.php +++ b/include/class/class_acc_ledger_fin.php @@ -901,6 +901,7 @@ class Acc_Ledger_Fin extends Acc_Ledger $oppaid->set_id($rRapt); $oppaid->set_paid(); } catch (Exception $ex) { + record_log($ex->getTraceAsString()); echo _('Attention , erreur Acc_Ledger_Fin::insert , coche paiement'); } } @@ -921,6 +922,7 @@ class Acc_Ledger_Fin extends Acc_Ledger $oppaid->set_paid(); } } catch (Exception $ex) { + record_log($ex->getTraceAsString()); echo _('Attention , erreur Acc_Ledger_Fin::insert , coche paiement'); } } @@ -986,6 +988,7 @@ class Acc_Ledger_Fin extends Acc_Ledger __FILE__ . ':' . __LINE__ . ' ' . $e->getMessage(); $this->db->rollback(); + record_log($e->getTraceAsString()); throw new Exception($r); } $this->db->commit(); diff --git a/include/class/class_acc_ledger_info.php b/include/class/class_acc_ledger_info.php index d4066187d..0e0542cd0 100644 --- a/include/class/class_acc_ledger_info.php +++ b/include/class/class_acc_ledger_info.php @@ -63,6 +63,7 @@ class Acc_Ledger_Info } catch (Exception $e) { + record_log($e->getTraceAsString()); echo "Echec sauvegarde info additionnelles"; throw $e; } @@ -85,6 +86,7 @@ class Acc_Ledger_Info } catch (Exception $e) { + record_log($e->getTraceAsString()); $this->cn->rollback(); echo "Echec sauvegarde info additionnelles"; throw $e; diff --git a/include/class/class_acc_ledger_purchase.php b/include/class/class_acc_ledger_purchase.php index 99067929d..d44563d4d 100644 --- a/include/class/class_acc_ledger_purchase.php +++ b/include/class/class_acc_ledger_purchase.php @@ -914,11 +914,12 @@ class Acc_Ledger_Purchase extends Acc_Ledger }//end try catch (Exception $e) { + record_log($e->getTraceAsString()); echo ''. 'Erreur dans l\'enregistrement '. __FILE__.':'.__LINE__.' '. $e->getMessage().$e->getMessage(); - error_log($e->getMessage()); + record_log($e->getMessage()); $this->db->rollback(); throw new Exception($e); } @@ -1024,6 +1025,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger } catch (Exception $e) { + record_log($e->getTraceAsString()); if ($e->getCode() == 1 ) { throw new Exception( _("Aucune période ouverte")); diff --git a/include/class/class_acc_ledger_sold.php b/include/class/class_acc_ledger_sold.php index b2b0faa6d..c331abd13 100644 --- a/include/class/class_acc_ledger_sold.php +++ b/include/class/class_acc_ledger_sold.php @@ -582,6 +582,7 @@ class Acc_Ledger_Sold extends Acc_Ledger { } } } catch (Exception $e) { + record_log($e->getTraceAsString()); echo '' . 'Erreur dans l\'enregistrement ' . __FILE__ . ':' . __LINE__ . ' ' . diff --git a/include/class/class_acc_report.php b/include/class/class_acc_report.php index 14b1b18d2..b3f7dc76d 100644 --- a/include/class/class_acc_report.php +++ b/include/class/class_acc_report.php @@ -216,6 +216,7 @@ class Acc_Report } catch (Exception $e) { + record_log($e->getTraceAsString()); $this->db->rollback(); echo $e->getMessage(); } @@ -257,6 +258,7 @@ class Acc_Report } catch (Exception $e) { + record_log($e->getTraceAsString()); $this->db->rollback(); echo $e->getMessage(); } diff --git a/include/class/class_anc_account.php b/include/class/class_anc_account.php index 870be0361..8a18c4605 100644 --- a/include/class/class_anc_account.php +++ b/include/class/class_anc_account.php @@ -119,6 +119,7 @@ class Anc_Account } catch (Exception $e) { + record_log($e->getTraceAsString()); if ( DEBUG ) print_r($e); echo "

Doublon : l'enregistrement n'est pas sauve

"; } @@ -150,6 +151,7 @@ class Anc_Account } catch (Exception $e) { + record_log($e->getTraceAsString()); echo "

Doublon : l'enregistrement n'est pas sauve

"; } diff --git a/include/class/class_anc_group_operation.php b/include/class/class_anc_group_operation.php index be88b867a..6bd6de1df 100644 --- a/include/class/class_anc_group_operation.php +++ b/include/class/class_anc_group_operation.php @@ -74,6 +74,7 @@ class Anc_Group_Operation } catch (Exception $e) { + record_log($e->getTraceAsString()); echo $e->getTrace(); $this->db->rollback(); throw new Exception($e); @@ -239,6 +240,7 @@ class Anc_Group_Operation } catch (Exception $ex) { + record_log($e->getTraceAsString()); echo ''. 'Erreur dans l\'enregistrement '. __FILE__.':'.__LINE__.' '. diff --git a/include/class/class_anc_key.php b/include/class/class_anc_key.php index 8467723d5..e2da2578c 100644 --- a/include/class/class_anc_key.php +++ b/include/class/class_anc_key.php @@ -265,8 +265,9 @@ class Anc_Key } catch (Exception $e) { + if ( DEBUG ) { echo $e->getTraceAsString(); } else { echo _('erreur').$e->getMessage();} - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); $cn->rollback(); } } diff --git a/include/class/class_anc_operation.php b/include/class/class_anc_operation.php index 042831f3c..119a2bd34 100644 --- a/include/class/class_anc_operation.php +++ b/include/class/class_anc_operation.php @@ -492,7 +492,7 @@ class Anc_Operation } catch (Exception $e) { - var_dump($e); + record_log($e->getTraceAsString()); } } /*!\brief display the form for PA diff --git a/include/class/class_default_menu.php b/include/class/class_default_menu.php index 1419bb43b..64d474671 100644 --- a/include/class/class_default_menu.php +++ b/include/class/class_default_menu.php @@ -106,7 +106,7 @@ class Default_Menu } } catch (Exception $e) { - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); echo $e->getMessage(); throw $e; } diff --git a/include/class/class_document_modele.php b/include/class/class_document_modele.php index c42551e23..8a9ba50c6 100644 --- a/include/class/class_document_modele.php +++ b/include/class/class_document_modele.php @@ -191,6 +191,7 @@ class Document_modele } catch (Exception $e) { + record_log($e->getTraceAsString()); rollback($this->cn); return ; } @@ -356,6 +357,7 @@ class Document_modele } catch (Exception $e) { + record_log($e->getTraceAsString()); rollback($this->cn); return ; } diff --git a/include/class/class_document_type.php b/include/class/class_document_type.php index 0630adc15..1a8357e20 100644 --- a/include/class/class_document_type.php +++ b/include/class/class_document_type.php @@ -103,6 +103,7 @@ class Document_type } catch (Exception $e) { + record_log($e->getTraceAsString()); alert(j(_("Impossible d'ajouter [$p_value] ") . $e->getMessage())); } } @@ -119,6 +120,7 @@ class Document_type } catch (Exception $e) { + record_log($e->getTraceAsString()); alert(" Erreur " . $e->getMessage()); } } @@ -131,6 +133,7 @@ class Document_type } catch (Exception $e) { + record_log($e->getTraceAsString()); alert("Erreur " . $e->getMessage()); } } diff --git a/include/class/class_dossier.php b/include/class/class_dossier.php index 9b9fd7890..68f9e1749 100644 --- a/include/class/class_dossier.php +++ b/include/class/class_dossier.php @@ -327,8 +327,9 @@ class Dossier } catch (Exception $e) { + echo_warning($e->getMessage()); - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); $cn->rollback(); } } diff --git a/include/class/class_fiche_attr.php b/include/class/class_fiche_attr.php index eaf1d22e4..1e7a140f5 100644 --- a/include/class/class_fiche_attr.php +++ b/include/class/class_fiche_attr.php @@ -99,6 +99,7 @@ class Fiche_Attr $this->cn->exec_sql($this->ad_extra); }catch (Exception $e) { + record_log($e->getTraceAsString()); throw new Exception ("La requête SQL ".h($this->ad_extra)." est invalide "); } } @@ -160,6 +161,7 @@ class Fiche_Attr ); } catch (Exception $e) { + record_log($e->getTraceAsString()); throw $e; } @@ -183,6 +185,7 @@ class Fiche_Attr ); }catch (Exception $e) { + record_log($e->getTraceAsString()); throw $e; } diff --git a/include/class/class_follow_up.php b/include/class/class_follow_up.php index 08425b395..5982f5563 100644 --- a/include/class/class_follow_up.php +++ b/include/class/class_follow_up.php @@ -125,7 +125,7 @@ class Follow_Up { $sql=" ( ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile and ua_right='W' ) )"; } else { - error_log(_('Securité')); + record_log(_('Securité')); throw new Exception(_('Securité')); } return $sql; diff --git a/include/class/class_periode.php b/include/class/class_periode.php index 8f05c77f0..c19c7e7b9 100644 --- a/include/class/class_periode.php +++ b/include/class/class_periode.php @@ -424,6 +424,7 @@ class Periode } catch (Exception $e) { + record_log($e->getTraceAsString()); $this->cn->rollback(); return 1; } @@ -570,6 +571,7 @@ class Periode } catch (Exception $e) { + record_log($e->getTraceAsString()); $this->cn->rollback(); } } diff --git a/include/class/class_pre_op_ach.php b/include/class/class_pre_op_ach.php index 1975a8da7..a8f69f0fd 100644 --- a/include/class/class_pre_op_ach.php +++ b/include/class/class_pre_op_ach.php @@ -103,6 +103,7 @@ class Pre_op_ach extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_pre_op_advanced.php b/include/class/class_pre_op_advanced.php index f48bd1bfd..a728e39bc 100644 --- a/include/class/class_pre_op_advanced.php +++ b/include/class/class_pre_op_advanced.php @@ -99,6 +99,7 @@ class Pre_Op_Advanced extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_pre_op_fin.php b/include/class/class_pre_op_fin.php index 25e475207..9316f8727 100644 --- a/include/class/class_pre_op_fin.php +++ b/include/class/class_pre_op_fin.php @@ -86,6 +86,7 @@ class Pre_op_fin extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_pre_op_ods.php b/include/class/class_pre_op_ods.php index db576ba6b..fa1bbec24 100644 --- a/include/class/class_pre_op_ods.php +++ b/include/class/class_pre_op_ods.php @@ -78,6 +78,7 @@ class Pre_op_ods extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_pre_op_ven.php b/include/class/class_pre_op_ven.php index d72637061..29a83a41c 100644 --- a/include/class/class_pre_op_ven.php +++ b/include/class/class_pre_op_ven.php @@ -102,6 +102,7 @@ class Pre_op_ven extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_stock_goods.php b/include/class/class_stock_goods.php index ac451f046..379480a66 100644 --- a/include/class/class_stock_goods.php +++ b/include/class/class_stock_goods.php @@ -165,7 +165,7 @@ class Stock_Goods extends Stock_Goods_Sql } catch (Exception $exc) { - error_log( $exc->getTraceAsString()); + record_log( $exc->getTraceAsString()); echo $exc->getMessage(); throw $exc; } diff --git a/include/lib/class_database.php b/include/lib/class_database.php index f54642deb..e484713aa 100644 --- a/include/lib/class_database.php +++ b/include/lib/class_database.php @@ -200,7 +200,7 @@ class Database echo $a->getTraceAsString(); echo pg_last_error($this->db); } - error_log($a->getTraceAsString()); + record_log($a->getTraceAsString()); $this->rollback(); throw ($a); diff --git a/include/lib/class_noalyss_csv.php b/include/lib/class_noalyss_csv.php index bc83428c9..c01861083 100644 --- a/include/lib/class_noalyss_csv.php +++ b/include/lib/class_noalyss_csv.php @@ -46,7 +46,7 @@ class Noalyss_Csv private function correct_name() { if (trim(strlen($this->filename))==0) { - error_log('CSV->correct_name filename is empty'); + record_log('CSV->correct_name filename is empty'); throw new Exception('CSV-CORRECT_NAME'); } $this->filename.="-".date("ymd-Hi"); diff --git a/include/param_sec.inc.php b/include/param_sec.inc.php index 91609f4b9..4a61d9655 100644 --- a/include/param_sec.inc.php +++ b/include/param_sec.inc.php @@ -183,7 +183,7 @@ if ( isset($_POST['ok'])) catch (Exception $e) { echo_warning ($e->getMessage()); - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); $cn->rollback(); } diff --git a/include/profile.inc.php b/include/profile.inc.php index 9ad4aa417..63715e893 100644 --- a/include/profile.inc.php +++ b/include/profile.inc.php @@ -58,7 +58,7 @@ if (isset($_POST['change_profile'])) catch (Exception $exc) { echo $exc->getMessage(); - error_log( $exc->getTraceAsString()); + record_log( $exc->getTraceAsString()); throw $exc; } } @@ -97,7 +97,7 @@ if (isset($_POST['change_stock'])) catch (Exception $exc) { echo $exc->getMessage(); - error_log($exc->getTraceAsString()); + record_log($exc->getTraceAsString()); throw $exc; } }