From 25635a296a60c9c1fe954fef4744bb68cbd15838 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 15 Nov 2014 01:50:12 +0100 Subject: [PATCH] Replace in inc file exit by return --- include/action.common.inc.php | 8 ++++---- include/adm.inc.php | 2 +- include/anc_od.inc.php | 8 ++++---- include/bank.inc.php | 2 +- include/category_card.inc.php | 2 +- include/cfgfiche.inc.php | 12 ++++++------ include/company.inc.php | 2 +- include/compta_ach.inc.php | 6 +++--- include/compta_fin.inc.php | 6 +++--- include/compta_fin_rec.inc.php | 4 ++-- include/compta_fin_saldo.inc.php | 2 +- include/compta_ods.inc.php | 8 ++++---- include/compta_ven.inc.php | 6 +++--- include/contact.inc.php | 2 +- include/customer.inc.php | 2 +- include/dossier.inc.php | 6 +++--- include/extension_get.inc.php | 6 +++--- include/fiche.inc.php | 10 +++++----- include/forecast.inc.php | 2 +- include/impress_gl_comptes.inc.php | 2 +- include/impress_poste.inc.php | 4 ++-- include/impress_rec.inc.php | 4 ++-- include/lettering.account.inc.php | 2 +- include/lettering.gestion.inc.php | 2 +- include/manager.inc.php | 2 +- include/modele.inc.php | 6 +++--- include/opening.inc.php | 10 +++++----- include/operation_ods_new.inc.php | 2 +- include/param_sec.inc.php | 2 +- include/payment_middle.inc.php | 4 ++-- include/preod.inc.php | 2 +- include/report.inc.php | 2 +- include/stock_cfg.inc.php | 2 +- include/supplier.inc.php | 2 +- include/tva.inc.php | 4 ++-- include/user.inc.php | 2 +- include/user_detail.inc.php | 4 ++-- 37 files changed, 77 insertions(+), 77 deletions(-) diff --git a/include/action.common.inc.php b/include/action.common.inc.php index e2b1b4056..689cc3d9c 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -52,7 +52,7 @@ if ( isset ($_POST['other_action_bt'])) { case 'IMP': //Impression Follow_Up::action_print($cn,$_POST); - exit(0); + return; break; case 'ST': // Etat @@ -124,7 +124,7 @@ if ($sub_action == "update") echo '
'; echo '

'._('Cette action ne vous est pas autorisée Contactez votre responsable').'

'; echo '
'; - exit(); + return; } $sub_action = "detail"; put_global(array(array('key' => "sa", "value" => "detail"))); @@ -195,7 +195,7 @@ if ($sub_action == 'detail') else { echo h2info(_("Ce document n'est pas accessible")); - exit(); + return; } @@ -216,7 +216,7 @@ if ($sub_action == 'delete') Follow_Up::show_action_list($cn, $base); if (isset($act->ag_ref)) echo hb(_('Action ') . $act->ag_ref . _(' effacée')); - exit(); + return; } //-------------------------------------------------------------------------------- diff --git a/include/adm.inc.php b/include/adm.inc.php index 6829fe4d7..f3cadd19c 100644 --- a/include/adm.inc.php +++ b/include/adm.inc.php @@ -142,7 +142,7 @@ if ( $low_action == 'detail') { /* Menu */ require_once('category_card.inc.php'); - exit(); +return; } diff --git a/include/anc_od.inc.php b/include/anc_od.inc.php index 592783fe1..02f113326 100644 --- a/include/anc_od.inc.php +++ b/include/anc_od.inc.php @@ -41,7 +41,7 @@ if ( ! $m ) { echo '

'._('Aucun plan analytique défini').'

'; - exit(); + return; } @@ -111,7 +111,7 @@ if ( isset($_GET['see'])) echo '
'; echo $a->html_table($current); echo '
'; - exit(); + return; } if ( isset($_POST['save'])) { @@ -127,7 +127,7 @@ if ( isset($_POST['save'])) $a->save(); echo $a->show(); echo ''; - exit(); + return; } if ( isset($_GET['new'])) @@ -153,7 +153,7 @@ if ( isset($_GET['new'])) '; echo ''; - exit(); + return; } ?> diff --git a/include/bank.inc.php b/include/bank.inc.php index 8a5b4e0e6..8ee65634d 100644 --- a/include/bank.inc.php +++ b/include/bank.inc.php @@ -139,7 +139,7 @@ if ( $low_action == 'detail') { /* Menu */ require_once('category_card.inc.php'); - exit(); + return; } diff --git a/include/category_card.inc.php b/include/category_card.inc.php index ec24e9601..524e3c334 100644 --- a/include/category_card.inc.php +++ b/include/category_card.inc.php @@ -124,7 +124,7 @@ if ( $ss_action == 'cn') echo ''; echo _("Vous devez aller dans fiche et créer une catégorie pour les contacts"); echo ''; - exit(); + return; } /* Add button */ $f_add_button=new IButton('add_card'); diff --git a/include/cfgfiche.inc.php b/include/cfgfiche.inc.php index 2f641fcfd..40dcea7c4 100644 --- a/include/cfgfiche.inc.php +++ b/include/cfgfiche.inc.php @@ -43,7 +43,7 @@ if ( isset($_POST['add_line'])) $fiche_def->InsertAttribut($_REQUEST['ad_id']); echo $fiche_def->input_detail(); echo $retour; - exit(); + return; } /*******************************************************************************************/ // Remove an attribut @@ -55,7 +55,7 @@ if ( isset ($_POST['remove_line'])) $fiche_def->RemoveAttribut($_REQUEST['chk_remove']); echo $fiche_def->input_detail(); echo $retour; - exit(); + return; } /*******************************************************************************************/ // Try to remove a category @@ -99,7 +99,7 @@ if ( isset ($_POST['change_name'])) } echo $fiche_def->input_detail(); echo $retour; - exit(); + return; } /*******************************************************************************************/ // Save order of the attributes @@ -110,7 +110,7 @@ if ( isset($_POST['save_line'])) $fiche_def->save_order($_POST); echo $fiche_def->input_detail(); echo $retour; - exit(); + return; } /*******************************************************************************************/ // Save a new category of card @@ -126,13 +126,13 @@ if ( isset($_POST['add_modele'])) { echo $fiche_def->input_detail(); echo $retour; - exit(); + return; } else { $fiche_def->input_new(); echo $retour; - exit(); + return; } } else diff --git a/include/company.inc.php b/include/company.inc.php index fe2b09591..90c184141 100644 --- a/include/company.inc.php +++ b/include/company.inc.php @@ -145,5 +145,5 @@ echo ""; echo HtmlInput::submit("record_company", _("Sauve")); echo ""; echo ''; -exit(); +return; ?> diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php index 69dc8c5cf..fd2b9a6b4 100644 --- a/include/compta_ach.inc.php +++ b/include/compta_ach.inc.php @@ -80,7 +80,7 @@ if (isset($_POST['view_invoice'])) echo ''; echo ''; - exit(); + return; } } //------------------------------ @@ -141,7 +141,7 @@ if (isset($_POST['record'])) } echo ''; - exit(); + return; } } // ------------------------------ @@ -230,6 +230,6 @@ echo create_script(" update_name()"); echo ''; -exit(); +return; // end record invoice ?> \ No newline at end of file diff --git a/include/compta_fin.inc.php b/include/compta_fin.inc.php index f9ea7f4eb..d53be9505 100644 --- a/include/compta_fin.inc.php +++ b/include/compta_fin.inc.php @@ -85,7 +85,7 @@ if ( isset($_POST['save'])) echo ''; echo ''; - exit(); + return; } } //---------------------------------------- @@ -116,7 +116,7 @@ if ( isset($_POST['confirm'])) echo $a; echo ''; echo ''; - exit(); + return; } } //---------------------------------------- @@ -150,4 +150,4 @@ if ( ! isset ($_POST['e_date'])&& $g_parameter->MY_DATE_SUGGEST=='Y') echo create_script(" ajax_saldo('first_sold');"); } echo create_script(" update_name()"); -exit(); \ No newline at end of file +return; \ No newline at end of file diff --git a/include/compta_fin_rec.inc.php b/include/compta_fin_rec.inc.php index 16c12b316..130acd688 100644 --- a/include/compta_fin_rec.inc.php +++ b/include/compta_fin_rec.inc.php @@ -43,7 +43,7 @@ $jrn_priv = $g_user->get_ledger_access($Ledger->id); if (isset($_GET["p_jrn"]) && $jrn_priv == "X") { NoAccess(); - exit(); + return; } //------------------------- // save @@ -214,5 +214,5 @@ echo ''; echo HtmlInput::submit('save', 'Mettre à jour le n° de relevé bancaire'); echo ''; echo ''; -exit(); +return; ?> diff --git a/include/compta_fin_saldo.inc.php b/include/compta_fin_saldo.inc.php index 373dec808..6cd396932 100644 --- a/include/compta_fin_saldo.inc.php +++ b/include/compta_fin_saldo.inc.php @@ -123,5 +123,5 @@ require_once ('class_acc_parm_code.php'); echo ''; echo ""; echo ""; - exit(); + return; ?> diff --git a/include/compta_ods.inc.php b/include/compta_ods.inc.php index bb65daf40..1f1d1da2f 100644 --- a/include/compta_ods.inc.php +++ b/include/compta_ods.inc.php @@ -64,7 +64,7 @@ if ($g_user->check_jrn($ledger->id) == 'X') if (!isset($_POST['summary']) && !isset($_POST['save'])) { require('operation_ods_new.inc.php'); - exit(); + return; } elseif (isset($_POST['summary'])) { @@ -77,7 +77,7 @@ elseif (isset($_POST['summary'])) require('operation_ods_new.inc.php'); } - exit(); + return; } elseif (isset($_POST['save'])) { @@ -104,7 +104,7 @@ elseif (isset($_POST['save'])) require('operation_ods_new.inc.php'); alert($e->getMessage()); } - exit(); + return; } -exit(); +return; diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php index 74a9fbd78..7a334b378 100644 --- a/include/compta_ven.inc.php +++ b/include/compta_ven.inc.php @@ -88,7 +88,7 @@ global $g_parameter; echo ''; echo ''; - exit(); + return; } } //------------------------------ @@ -148,7 +148,7 @@ global $g_parameter; echo ''; - exit(); + return; } } // ------------------------------ @@ -250,5 +250,5 @@ echo '
'; echo create_script(" get_last_date()"); } echo create_script(" update_name()"); -exit(); +return; ?> diff --git a/include/contact.inc.php b/include/contact.inc.php index 829f028b6..71678287f 100644 --- a/include/contact.inc.php +++ b/include/contact.inc.php @@ -147,7 +147,7 @@ if ( $low_action == 'detail') { /* Menu */ require_once('category_card.inc.php'); - exit(); + return; } html_page_stop(); diff --git a/include/customer.inc.php b/include/customer.inc.php index 87554bd47..b1e867786 100644 --- a/include/customer.inc.php +++ b/include/customer.inc.php @@ -137,7 +137,7 @@ if ( $low_action == 'detail') { /* Menu */ require_once('category_card.inc.php'); - exit(); + return; } html_page_stop(); diff --git a/include/dossier.inc.php b/include/dossier.inc.php index ccd9562c8..ec7c663bd 100644 --- a/include/dossier.inc.php +++ b/include/dossier.inc.php @@ -58,7 +58,7 @@ if ( isset ($_POST["DATABASE"]) ) echo _('le modele ').domaine.'mod'.$_POST["FMOD_ID"]._(" doit être migré en unicode."); echo _('Pour le passer en unicode, faites-en un backup puis restaurez le fichier reçu').''; echo HtmlInput::button_anchor('Retour','admin_repo.php?action=dossier_mgt'); - exit(); + return; } $desc=sql_string($_POST["DESCRIPTION"]); @@ -344,7 +344,7 @@ if ( $sa == 'remove' ) { echo _('Désolé, vous n\'avez pas coché la case'); echo HtmlInput::button_anchor('Retour','?action=dossier_mgt'); - exit(); + return; } $cn=new Database(); @@ -353,7 +353,7 @@ if ( $sa == 'remove' ) if ( strlen(trim($name)) == 0 ) { echo "

$msg "._('inexistant')."

"; - exit(); + return; } $sql="drop database ".domaine."dossier".sql_string($_REQUEST['d']); ob_start(); diff --git a/include/extension_get.inc.php b/include/extension_get.inc.php index fc76e0d76..e051490bc 100644 --- a/include/extension_get.inc.php +++ b/include/extension_get.inc.php @@ -26,17 +26,17 @@ $ext=new Extension(); if ($ext->search($_REQUEST['plugin_code']) == -1) { echo_warning("plugin non trouvé"); - exit(); + return; } if ($ext->can_request($g_user->login)==-1) { alert("Plugin non authorisé"); - exit(); + return; } if ( ! file_exists('../include/ext'.DIRECTORY_SEPARATOR.trim($ext->me_file))) { alert(j(_("Ce fichier n'existe pas "))); - exit(); + return; } echo '
'; require_once('ext'.DIRECTORY_SEPARATOR.trim($ext->me_file)); diff --git a/include/fiche.inc.php b/include/fiche.inc.php index ea2393ff0..053135ae8 100644 --- a/include/fiche.inc.php +++ b/include/fiche.inc.php @@ -103,7 +103,7 @@ echo '
'; //----------------------------------------------------- if (!isset($_GET['cat_display'])) - exit(); + return; $fd_id = $_GET['cat']; @@ -123,7 +123,7 @@ if ($array == null) echo '

'._('Aucune fiche trouvée').'

'; echo $str_add_card; echo '
'; - exit(); + return; } $allcard = (isset($_GET['allcard'])) ? 1 : 0; @@ -218,7 +218,7 @@ if ($_GET['histo'] == -1) require_once 'template/fiche_list.php'; echo '
'.$bar; - exit(); + return; } /* * ********************************************************************************************************************************* * Summary @@ -241,7 +241,7 @@ if ($_GET['histo'] == 3) $hid->input("fd_id", $_REQUEST['cat']); echo ""; - exit(); + return; } $export_pdf = '
'; $export_pdf.=HtmlInput::hidden('cat', $_GET['cat']); @@ -373,7 +373,7 @@ if ($_GET['histo'] == 4 || $_GET['histo'] == 5) echo $export_csv; echo $export_print; - exit(); + return; } if (isDate($_REQUEST['start']) == null || isDate($_REQUEST['end']) == null) { diff --git a/include/forecast.inc.php b/include/forecast.inc.php index 33859bd33..20557a278 100644 --- a/include/forecast.inc.php +++ b/include/forecast.inc.php @@ -366,7 +366,7 @@ if (isset($_REQUEST['f_id']) && $sa == "vw") echo '
'; echo '
'; echo ''; - exit(); + return; } catch (Exception $e) { diff --git a/include/impress_gl_comptes.inc.php b/include/impress_gl_comptes.inc.php index 21c416d65..e20f6b9f4 100644 --- a/include/impress_gl_comptes.inc.php +++ b/include/impress_gl_comptes.inc.php @@ -147,7 +147,7 @@ if ( isset( $_REQUEST['bt_html'] ) ) if ( isDate($_REQUEST['from_periode'])==null || isDate($_REQUEST['to_periode'])==null) { echo alert('Date malformée, désolée'); - exit(); + return; } echo '
'; diff --git a/include/impress_poste.inc.php b/include/impress_poste.inc.php index d6c55c01c..0532ff4db 100644 --- a/include/impress_poste.inc.php +++ b/include/impress_poste.inc.php @@ -134,7 +134,7 @@ if ( isset( $_REQUEST['bt_html'] ) ) if ( isDate($_REQUEST['from_periode'])==null || isDate($_REQUEST['to_periode'])==null) { echo alert('Date malformée, désolée'); - exit(); + return; } require_once("class_acc_account_ledger.php"); $go=0; @@ -187,7 +187,7 @@ if ( isset( $_REQUEST['bt_html'] ) ) Acc_Account_Ledger::HtmlTableHeader(); $Poste->get_row_date( $_GET['from_periode'], $_GET['to_periode'],$_GET['ople']); - if ( empty($Poste->row)) exit(); + if ( empty($Poste->row)) return; $Poste->load(); echo ''; diff --git a/include/impress_rec.inc.php b/include/impress_rec.inc.php index 4f8bec5fb..0beee6bce 100644 --- a/include/impress_rec.inc.php +++ b/include/impress_rec.inc.php @@ -82,7 +82,7 @@ echo '
'; echo ''; echo ''; echo '
'; -if ( ! isset($_GET['vis'])) exit(); +if ( ! isset($_GET['vis'])) return; $acc_reconciliation=new Acc_Reconciliation($cn); $acc_reconciliation->a_jrn=$r_jrn; $acc_reconciliation->start_day=$dstart->value; @@ -100,4 +100,4 @@ $gDossier=Dossier::id(); '; if ( isDate($_GET['start']) == null || isDate($_GET['end']) == null ) { echo alert(_('Date malformée, désolé')); - exit(); + return; } $letter=new Lettering_Account($cn); $letter->set_parameter('account',$_GET['acc']); diff --git a/include/lettering.gestion.inc.php b/include/lettering.gestion.inc.php index 0da3fc750..a421b7c41 100644 --- a/include/lettering.gestion.inc.php +++ b/include/lettering.gestion.inc.php @@ -71,7 +71,7 @@ if ( isset($_GET['start']) && isset($_GET['end'])) if ( isDate($_GET['start']) == null || isDate($_GET['end']) == null ) { echo alert(_('Date malformée, désolé')); - exit(); + return; } } echo '
'; diff --git a/include/manager.inc.php b/include/manager.inc.php index 382de0488..2064b710f 100644 --- a/include/manager.inc.php +++ b/include/manager.inc.php @@ -139,7 +139,7 @@ if ($low_action == 'detail') { /* Menu */ require_once('category_card.inc.php'); - exit(); + return; } diff --git a/include/modele.inc.php b/include/modele.inc.php index 5480dc518..a571c9973 100644 --- a/include/modele.inc.php +++ b/include/modele.inc.php @@ -70,7 +70,7 @@ if (isset($_POST["FMOD_NAME"])) echo ' Pour le passer en unicode, faites-en un backup puis restaurez le fichier reçu'; echo HtmlInput::button_anchor('Retour', 'admin_repo.php?action=dossier_mgt'); - exit(); + return; } $mod_name = sql_string($_POST["FMOD_NAME"]); @@ -387,7 +387,7 @@ if ($sa == 'add') { echo('Désolé, vous n\'avez pas coché la case'); echo HtmlInput::button_anchor('Retour', '?action=modele_mgt'); - exit(); + return; } $cn = new Database(); @@ -396,7 +396,7 @@ if ($sa == 'add') if (strlen(trim($name)) == 0) { echo "

$msg inexistant

"; - exit(); + return; } $sql = "drop database " . domaine . "mod" . sql_string($_REQUEST['m']); ob_start(); diff --git a/include/opening.inc.php b/include/opening.inc.php index d639124b2..b9fc4689d 100644 --- a/include/opening.inc.php +++ b/include/opening.inc.php @@ -42,7 +42,7 @@ if (isset($_POST['correct'])) { $ledger = new Acc_Ledger($cn, $_REQUEST['p_jrn']); require_once 'operation_ods_new.inc.php'; - exit(); + return; } // confirm before saving @@ -59,7 +59,7 @@ if ( isset($_POST['summary'])) require('operation_ods_new.inc.php'); } - exit(); + return; } // record @@ -89,7 +89,7 @@ if (isset($_POST['save'])) require('operation_ods_new.inc.php'); alert($e->getMessage()); } - exit(); + return; } @@ -108,7 +108,7 @@ if ($sa == '') if (empty($avail)) { echo '*** Aucun dossier ***'; - exit(); + return; } echo '
'; echo HtmlInput::hidden('ac', $_REQUEST['ac']); @@ -132,7 +132,7 @@ if ($sa == '') echo ''; echo '
'; echo '
'; - exit(); + return; } /* -------------------------------------------------- * Step 2 choose now the exercice of this folder diff --git a/include/operation_ods_new.inc.php b/include/operation_ods_new.inc.php index 0e6cc84cc..ce1e9a40f 100644 --- a/include/operation_ods_new.inc.php +++ b/include/operation_ods_new.inc.php @@ -41,7 +41,7 @@ $ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id_ledger; if ( $g_user->check_jrn($ledger->id)=='X') { alert("Vous ne pouvez pas écrire dans ce journal, contacter votre administrateur"); - exit(); + return; } echo '
'; echo '
'; diff --git a/include/param_sec.inc.php b/include/param_sec.inc.php index d2d9adf7e..9ee99b365 100644 --- a/include/param_sec.inc.php +++ b/include/param_sec.inc.php @@ -230,7 +230,7 @@ if ( $action == "view" ) l'écran administration -> utilisateur.

"; echo $return; - exit(); + return; } // // Check if the user can access that folder diff --git a/include/payment_middle.inc.php b/include/payment_middle.inc.php index 1fb7eddfe..5a634b0f3 100644 --- a/include/payment_middle.inc.php +++ b/include/payment_middle.inc.php @@ -57,7 +57,7 @@ if ( $sb=='change') '?p_action=divers&sa=mp&'.dossier::get()."&ac=".$_REQUEST['ac'] ); echo ''; - exit(); + return; } //---------------------------------------------------------------------- // Save the change @@ -106,7 +106,7 @@ if ($sb=='ins') ); echo ''; - exit(); + return; } //-------------------------------------------------------------------------------- //LIST diff --git a/include/preod.inc.php b/include/preod.inc.php index 777730d25..75815e3f4 100644 --- a/include/preod.inc.php +++ b/include/preod.inc.php @@ -80,7 +80,7 @@ if ( $request_sa== 'jrn' ) if (empty($array) == true) { echo _("Aucun enregistrement"); - exit(); + return; } echo '
'; diff --git a/include/report.inc.php b/include/report.inc.php index 5f5cf1b2f..eb8480a7d 100644 --- a/include/report.inc.php +++ b/include/report.inc.php @@ -82,7 +82,7 @@ echo "
"; echo '
'; if ( isset($_POST['upload'])) { - exit(); + return; } if ( isset ($_REQUEST["action"]) ) { diff --git a/include/stock_cfg.inc.php b/include/stock_cfg.inc.php index 6c7ada2b1..cd307145b 100644 --- a/include/stock_cfg.inc.php +++ b/include/stock_cfg.inc.php @@ -36,7 +36,7 @@ if ($g_parameter->MY_STOCK == 'N') echo '

'; echo _("Vous n'utilisez pas de gestion de stock"); echo '

'; - exit(); + return; } if ( isset ($_POST['add_stock'])) { diff --git a/include/supplier.inc.php b/include/supplier.inc.php index 7b49b36ee..0dc5a652a 100644 --- a/include/supplier.inc.php +++ b/include/supplier.inc.php @@ -143,7 +143,7 @@ if ( $low_action == 'detail') { /* Menu */ require_once('category_card.inc.php'); - exit(); + return; } diff --git a/include/tva.inc.php b/include/tva.inc.php index 4446e2669..9b65f850b 100644 --- a/include/tva.inc.php +++ b/include/tva.inc.php @@ -90,8 +90,8 @@ if (isset($_POST['confirm_mod']) $own = new Own($cn); if ($own->MY_TVA_USE == 'N') { - echo '

Vous n\'êtes pas assujetti à la TVA

'; - exit(); + echo '

'._("Vous n'êtes pas assujetti à la TVA").'

'; + return; } //----------------------------------------------------- // Display diff --git a/include/user.inc.php b/include/user.inc.php index 3646e69f3..85799eed6 100644 --- a/include/user.inc.php +++ b/include/user.inc.php @@ -61,7 +61,7 @@ if ( isset($_REQUEST['det'])) { require_once("user_detail.inc.php"); - exit(); + return; } ?> diff --git a/include/user_detail.inc.php b/include/user_detail.inc.php index 6b5fa8046..9905dec56 100644 --- a/include/user_detail.inc.php +++ b/include/user_detail.inc.php @@ -31,7 +31,7 @@ $rep = new Database(); if (!isset($_REQUEST['use_id'])) { html_page_stop(); - exit(); + return; } $uid = $_REQUEST['use_id']; $UserChange = new User($rep, $uid); @@ -210,7 +210,7 @@ if (empty($Dossier)) { echo hb('* Aucun Dossier *'); echo ''; - exit(); + return; } $mod_user = new User(new Database(), $uid);