From c151ef7b871e141c297270629c14c731662fadb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 6 Sep 2013 12:10:09 +0200 Subject: [PATCH] Qual: Remove duplicate form instanciation. --- htdocs/adherents/admin/adherent.php | 3 ++- htdocs/adherents/cotisations.php | 1 - htdocs/adherents/fiche.php | 2 +- htdocs/adherents/type.php | 3 --- htdocs/admin/const.php | 5 ++-- htdocs/admin/delais.php | 3 ++- htdocs/admin/modules.php | 3 ++- htdocs/admin/tools/index.php | 4 +-- htdocs/categories/fiche.php | 3 ++- htdocs/comm/fiche.php | 1 - htdocs/comm/remx.php | 4 +-- htdocs/commande/document.php | 4 +-- htdocs/compta/bank/account.php | 4 +-- htdocs/compta/bank/bankid_fr.php | 4 +-- htdocs/compta/bank/fiche.php | 4 +-- htdocs/compta/bank/ligne.php | 4 +-- htdocs/compta/deplacement/document.php | 4 +-- htdocs/compta/deplacement/fiche.php | 4 +-- htdocs/compta/facture/document.php | 4 +-- htdocs/compta/paiement/cheque/fiche.php | 8 +++--- htdocs/compta/paiement/fiche.php | 8 +++--- htdocs/compta/payment_sc/fiche.php | 8 +++--- htdocs/compta/prelevement/fiche.php | 4 +-- htdocs/contact/fiche.php | 8 +++--- htdocs/contrat/document.php | 4 +-- htdocs/contrat/fiche.php | 14 +++++----- htdocs/cron/card.php | 14 +++++----- htdocs/cron/list.php | 8 +++--- htdocs/ecm/docdir.php | 4 +-- htdocs/ecm/docfile.php | 4 +-- htdocs/ecm/docmine.php | 8 +++--- htdocs/ecm/docother.php | 4 +-- htdocs/ecm/index.php | 8 +++--- htdocs/expedition/fiche.php | 12 ++++----- htdocs/expedition/shipment.php | 4 +-- htdocs/exports/export.php | 4 +-- htdocs/fichinter/document.php | 4 +-- htdocs/fichinter/fiche.php | 16 ++++++------ htdocs/fourn/commande/document.php | 4 +-- htdocs/fourn/commande/fiche.php | 34 ++++++++++++------------- htdocs/fourn/facture/document.php | 4 +-- htdocs/fourn/facture/fiche.php | 14 +++++----- htdocs/fourn/paiement/fiche.php | 8 +++--- htdocs/ftp/index.php | 8 +++--- htdocs/holiday/fiche.php | 10 ++++---- htdocs/imports/import.php | 4 +-- htdocs/livraison/fiche.php | 8 +++--- htdocs/product/composition/fiche.php | 1 - htdocs/product/photos.php | 4 +-- htdocs/product/stock/fiche.php | 4 +-- htdocs/societe/notify/fiche.php | 2 -- htdocs/societe/soc.php | 2 -- htdocs/user/fiche.php | 6 ++--- 53 files changed, 153 insertions(+), 168 deletions(-) diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 87412802de0..275e9323223 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -102,6 +102,8 @@ if ($action == 'unset') * View */ +$form = new Form($db); + $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; llxHeader('',$langs->trans("MembersSetup"),$help_url); @@ -127,7 +129,6 @@ print '<td>'.$langs->trans("Value").'</td>'; print '<td align="center">'.$langs->trans("Action").'</td>'; print "</tr>\n"; $var=true; -$form = new Form($db); // Login/Pass required for members $var=!$var; diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index d0615896cc6..330bedf4862 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -171,7 +171,6 @@ if ($result) { print '<input type="hidden" name="action" value="2bank">'; print '<input type="hidden" name="rowid" value="'.$objp->crowid.'">'; - $form = new Form($db); $form->select_comptes('','accountid',0,'',1); print '<br>'; $form->select_types_paiements('','paymenttypeid'); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 302cb524f2a..e3bbe5b55a9 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -653,7 +653,7 @@ if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm /* * View -*/ + */ $form = new Form($db); $formcompany = new FormCompany($db); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index d221619acf4..7dd82f9a6a5 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -233,7 +233,6 @@ if (! $rowid && $action != 'create' && $action != 'edit') /* ************************************************************************** */ if ($action == 'create') { - $form = new Form($db); $adht = new AdherentType($db); print_fiche_titre($langs->trans("NewMemberType")); @@ -620,8 +619,6 @@ if ($rowid > 0) if ($action == 'edit') { - $form = new Form($db); - $adht = new AdherentType($db); $adht->id = $rowid; $adht->fetch($rowid); diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 66f8d3afaaf..94c660c9a3f 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -143,6 +143,8 @@ if ($action == 'delete') * View */ +$form = new Form($db); + llxHeader('',$langs->trans("OtherSetup")); // Add logic to show/hide buttons @@ -184,9 +186,6 @@ print '<td align="center">'.$langs->trans("Action").'</td>'; print "</tr>\n"; -$form = new Form($db); - - // Line to add new record $var=false; print "\n"; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 9397b6cd28c..7aeb6eb9f78 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -123,6 +123,8 @@ if ($action == 'update') * View */ +$form = new Form($db); + llxHeader(); print_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"),'','setup'); @@ -131,7 +133,6 @@ print $langs->transnoentities("DelaysOfToleranceDesc",img_warning()); print " ".$langs->trans("OnlyActiveElementsAreShown",DOL_URL_ROOT.'/admin/modules.php')."<br>\n"; print "<br>\n"; -$form = new Form($db); $countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>'; if ($action == 'edit') diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 45df64a5355..cfaa0c72004 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -66,6 +66,8 @@ if ($action == 'reset' && $user->admin) * View */ +$form = new Form($db); + $_SESSION["mode"]=$mode; $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; @@ -252,7 +254,6 @@ if (! empty($categ[$categidx])) $categidx='expdev'; if (! empty($categ[$categidx])) { - $form = new Form($db); $categidx='expdev'; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3); diff --git a/htdocs/admin/tools/index.php b/htdocs/admin/tools/index.php index 9dc1aef46b2..955d02b50f9 100644 --- a/htdocs/admin/tools/index.php +++ b/htdocs/admin/tools/index.php @@ -35,13 +35,13 @@ if (! $user->admin) * View */ +$form = new Form($db); + $title=$langs->trans("SystemToolsArea"); if (GETPOST('leftmenu') == 'modulesadmintools') $title=$langs->trans("ModulesSystemTools"); llxHeader(array(),$title); -$form = new Form($db); - print_fiche_titre($title,'','setup'); print $langs->trans("SystemToolsAreaDesc").'<br>'; diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index b5d23ed8740..d43c4df9a3d 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -193,9 +193,10 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr * View */ -llxHeader("","",$langs->trans("Categories")); $form = new Form($db); +llxHeader("","",$langs->trans("Categories")); + if ($user->rights->categorie->creer) { /* diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index f5409681be8..9021ad0acaf 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -299,7 +299,6 @@ if ($id > 0) // Conditions de reglement par defaut $langs->load('bills'); - $form = new Form($db); print '<tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>'; print $langs->trans('PaymentConditions'); diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index cfa83e78875..0de58ca2ed0 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -297,7 +297,7 @@ if ($socid > 0) if ($_GET['action'] == 'remove') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1); } /* @@ -394,7 +394,7 @@ if ($socid > 0) array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') ); $langs->load("dict"); - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); print '</td>'; print '</tr>'; } diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 1d599ee549d..61ad0aac194 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -145,8 +145,8 @@ if ($id > 0 || ! empty($ref)) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); + } // Affiche formulaire upload diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index d4da7ec74ac..888126a19f9 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -300,8 +300,8 @@ if ($id > 0 || ! empty($ref)) if ($action == 'delete') { $text=$langs->trans('ConfirmDeleteTransaction'); - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete'); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete'); + } // Define transaction list navigation string diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index dbe67212f37..f27cef41cb4 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -130,8 +130,8 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') // Confirmation de la suppression if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); + } diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 407a5398dc5..ba6f6ea62ec 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -373,8 +373,8 @@ else */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); + } print '<table class="border" width="100%">'; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index dcad7cd4f22..ef57d15d355 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -266,8 +266,8 @@ if ($result) // Confirmations if ($action == 'delete_categ') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1); + } print '<form name="update" method="POST" action="'.$_SERVER['PHP_SELF'].'?rowid='.$rowid.'">'; diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 9b07bccd7ae..26cdf746f46 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -146,8 +146,8 @@ if ($object->id) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); + } // Affiche formulaire upload diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index e82d962053d..808d9163222 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -436,8 +436,8 @@ else if ($id) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete"); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete"); + } $soc = new Societe($db); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 5671f4f8d9c..8aae07746e9 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -174,8 +174,8 @@ if ($id > 0 || ! empty($ref)) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); + } diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index e93113e028c..d7e9b4f0946 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -306,8 +306,8 @@ else */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1); + } /* @@ -315,8 +315,8 @@ else */ if ($action == 'valide') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1); + } } diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index 9f16508c590..cf7d70819fc 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -192,8 +192,8 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"), 0, 'p */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); + } /* @@ -202,8 +202,8 @@ if ($action == 'delete') if ($action == 'valide') { $facid = $_GET['facid']; - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); + } diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index 0ad3eaf8622..d502e6e2fc0 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -146,8 +146,8 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), 0, */ if ($_GET['action'] == 'delete') { - $ret=$form->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); - if ($ret == 'html') print '<br>'; + print $form->formconfirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); + } /* @@ -156,8 +156,8 @@ if ($_GET['action'] == 'delete') if ($_GET['action'] == 'valide') { $facid = $_GET['facid']; - $ret=$form->form_confirm('fiche.php?id='.$paiement->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); - if ($ret == 'html') print '<br>'; + print $form->formconfirm('fiche.php?id='.$paiement->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); + } diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index 22af3b3548d..5db8e38d912 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -150,8 +150,8 @@ if ($id > 0) /*if ($action == 'credite') { - $ret=$form->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1); + }*/ print '<table class="border" width="100%">'; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 7f587500cbe..a4389294fb1 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -343,8 +343,8 @@ else { if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); + } } @@ -839,8 +839,8 @@ else if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser"); else $text.=$langs->trans("UserWillBeInternalUser"); } - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); + } print '<table class="border" width="100%">'; diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 099befedb95..1dba64f57d7 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -145,8 +145,8 @@ if ($object->id) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); + } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 30aced500d7..f096cac29c7 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -947,8 +947,8 @@ else */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1); + } /* @@ -968,8 +968,8 @@ else $text=$langs->trans('ConfirmValidateContract',$numref); - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1); + } /* @@ -977,8 +977,8 @@ else */ if ($action == 'close') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1); + } /* @@ -1314,7 +1314,7 @@ else */ if ($action == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == GETPOST('rowid')) { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1); if ($ret == 'html') print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; } diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index f114f0c91cd..81e0ba99f26 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -209,6 +209,9 @@ if ($action=='inactive') * View */ +$form = new Form($db); +$formCron = new FormCron($db); + llxHeader('',$langs->trans("CronAdd")); if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute') @@ -244,19 +247,16 @@ if ($conf->use_javascript_ajax) print '</script>'."\n"; } -$form = new Form($db); -$formCron = new FormCron($db); - if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); + $action=''; } if ($action == 'execute'){ - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + $action=''; } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 1591c35d26a..7c391558cb9 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -122,14 +122,14 @@ print $langs->trans('CronInfo'); if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); + } if ($action == 'execute') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + } // liste des jobs creer diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php index 5ab21beed0d..ec16acdbc16 100644 --- a/htdocs/ecm/docdir.php +++ b/htdocs/ecm/docdir.php @@ -204,8 +204,8 @@ if (empty($action) || $action == 'delete_section') // Confirmation de la suppression d'une ligne categorie if ($action == 'delete_section') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); + } // Construit fiche rubrique diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/docfile.php index afb03ab867e..6b9dcc7d1a1 100644 --- a/htdocs/ecm/docfile.php +++ b/htdocs/ecm/docfile.php @@ -252,8 +252,8 @@ print '</div>'; // Confirmation de la suppression d'une ligne categorie if ($_GET['action'] == 'delete_file') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urlencode($_GET["section"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile',$urlfile), 'confirm_deletefile', '', 1, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($_GET["section"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile',$urlfile), 'confirm_deletefile', '', 1, 1); + } if ($_GET["action"] != 'edit') diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php index 8ba84f6fc76..94c5d06759d 100644 --- a/htdocs/ecm/docmine.php +++ b/htdocs/ecm/docmine.php @@ -334,16 +334,16 @@ if ($action != 'edit' && $action != 'delete') // Confirm remove file if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); + } // Confirm remove file if ($action == 'delete_dir') { $relativepathwithoutslash=preg_replace('/[\/]$/','',$relativepath); - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$relativepathwithoutslash), 'confirm_deletedir', '', 1, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$relativepathwithoutslash), 'confirm_deletedir', '', 1, 1); + } $formfile=new FormFile($db); diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php index 4c618c79e71..b74af256bc3 100644 --- a/htdocs/ecm/docother.php +++ b/htdocs/ecm/docother.php @@ -112,8 +112,8 @@ print_fiche_titre($langs->trans("ECMAutoOrg")); */ if ($_GET['action'] == 'delete_file') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); + } // Construit liste des fichiers diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index bb8844eafc6..85eddf47624 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -405,8 +405,8 @@ print '</div>'; // Confirm remove file (for non javascript users) if ($action == 'delete' && empty($conf->use_javascript_ajax)) { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); + } dol_htmloutput_mesg($mesg); @@ -455,8 +455,8 @@ print '</div>'; // Confirmation de la suppression d'une ligne categorie if ($action == 'delete_section') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); + } // End confirm diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 8f466aa377f..78db51c9620 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -924,8 +924,8 @@ else */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1); + } /* @@ -953,16 +953,16 @@ else $text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid); } - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1); + } /* * Confirmation de l'annulation */ if ($action == 'annuler') { - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1); + } // Calculate true totalWeight and totalVolume for all products diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 24f4bf73b0a..1e09cd47482 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -152,8 +152,8 @@ if ($id > 0 || ! empty($ref)) */ if ($action == 'cloture') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseShipment"),$langs->trans("ConfirmCloseShipment"),"confirm_cloture"); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseShipment"),$langs->trans("ConfirmCloseShipment"),"confirm_cloture"); + } // Onglet commande diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 98397ebe6c1..99ebd02c094 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -1025,8 +1025,8 @@ if ($step == 5 && $datatoexport) */ if ($action == 'remove_file') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); + } print '<table width="100%" class="border">'; diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index b9d70300c80..30349e5bc09 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -146,8 +146,8 @@ if ($object->id) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); + } // Affiche formulaire upload diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index d3947958450..1ec1fe22c3d 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1136,8 +1136,8 @@ else if ($id > 0 || ! empty($ref)) // Confirmation de la suppression de la fiche d'intervention if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1); + } // Confirmation validation @@ -1160,22 +1160,22 @@ else if ($id > 0 || ! empty($ref)) } $text=$langs->trans('ConfirmValidateIntervention',$numref); - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1); + } // Confirmation de la validation de la fiche d'intervention if ($action == 'modify') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1); + } // Confirmation de la suppression d'une ligne d'intervention if ($action == 'ask_deleteline') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.GETPOST('line_id','int'), $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.GETPOST('line_id','int'), $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1); + } print '<table class="border" width="100%">'; diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index d1fdaeb113e..da72a325574 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -181,8 +181,8 @@ if ($object->id > 0) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); + } // Affiche formulaire upload diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 77a7cce4e23..68467939a10 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1069,8 +1069,8 @@ elseif (! empty($object->id)) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2); + } // Clone confirmation @@ -1081,8 +1081,8 @@ elseif (! empty($object->id)) //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1) ); // Paiement incomplet. On demande si motif = escompte ou autre - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1); + } /* @@ -1105,8 +1105,8 @@ elseif (! empty($object->id)) $text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid); } - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1); + } /* @@ -1128,8 +1128,8 @@ elseif (! empty($object->id)) ); } - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder",$object->ref),"confirm_approve", $formquestion, 1, 1, 240); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder",$object->ref),"confirm_approve", $formquestion, 1, 1, 240); + } /* @@ -1137,8 +1137,8 @@ elseif (! empty($object->id)) */ if ($action == 'refuse') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1); + } /* @@ -1146,8 +1146,8 @@ elseif (! empty($object->id)) */ if ($action == 'cancel') { - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder",$object->ref),"confirm_cancel", '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder",$object->ref),"confirm_cancel", '', 0, 1); + } /* @@ -1156,8 +1156,8 @@ elseif (! empty($object->id)) if ($action == 'commande') { $date_com = dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id."&datecommande=".$date_com."&methode=".$_POST["methodecommande"]."&comment=".urlencode($_POST["comment"]), $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande",'',0,2); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id."&datecommande=".$date_com."&methode=".$_POST["methodecommande"]."&comment=".urlencode($_POST["comment"]), $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande",'',0,2); + } /* @@ -1165,8 +1165,8 @@ elseif (! empty($object->id)) */ if ($action == 'delete_product_line') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline','',0,2); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline','',0,2); + } /* @@ -1240,7 +1240,6 @@ elseif (! empty($object->id)) // Conditions de reglement par defaut $langs->load('bills'); - $form = new Form($db); print '<tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print $langs->trans('PaymentConditions'); @@ -1261,7 +1260,6 @@ elseif (! empty($object->id)) // Mode of payment $langs->load('bills'); - $form = new Form($db); print '<tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print $langs->trans('PaymentMode'); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 56b8f78762f..8ba991076f1 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -121,8 +121,8 @@ if ($object->id > 0) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); + } print '<table class="border" width="100%">'; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 1ee145b61fb..4fe504870cb 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1431,22 +1431,22 @@ else array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); } - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240); + } // Confirmation set paid if ($action == 'paid') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); + } // Confirmation de la suppression de la facture fournisseur if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); + } @@ -1636,7 +1636,6 @@ else // Conditions de reglement par defaut $langs->load('bills'); - $form = new Form($db); print '<tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print $langs->trans('PaymentConditions'); @@ -1657,7 +1656,6 @@ else // Mode of payment $langs->load('bills'); - $form = new Form($db); print '<tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print $langs->trans('PaymentMode'); diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php index 30afab7e935..f622a305ac1 100644 --- a/htdocs/fourn/paiement/fiche.php +++ b/htdocs/fourn/paiement/fiche.php @@ -161,8 +161,8 @@ if ($result > 0) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); + } /* @@ -170,8 +170,8 @@ if ($result > 0) */ if ($action == 'valide') { - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); + } print '<table class="border" width="100%">'; diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index e8416621de6..9c4f2cfffef 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -403,15 +403,15 @@ else // Confirm remove file if ($_GET['action'] == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); + } // Confirmation de la suppression d'une ligne categorie if ($_GET['action'] == 'delete_section') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); + } print $langs->trans("Server").': <b>'.$ftp_server.'</b><br>'; diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index a65df53706d..8176a80938c 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -832,7 +832,7 @@ else if ($action == 'delete' && $cp->statut == 1) { if($user->rights->holiday->delete) { - $ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1); + print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1); if ($ret == 'html') print '<br />'; } } @@ -840,14 +840,14 @@ else // Si envoi en validation if ($action == 'sendToValidate' && $cp->statut == 1 && $user->id == $cp->fk_user) { - $ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1); + print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1); if ($ret == 'html') print '<br />'; } // Si validation de la demande if ($action == 'valid' && $cp->statut == 2 && $user->id == $cp->fk_validator) { - $ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1); + print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1); if ($ret == 'html') print '<br />'; } @@ -855,14 +855,14 @@ else if ($action == 'refuse' && $cp->statut == 2 && $user->id == $cp->fk_validator) { $array_input = array(array('type'=>"text",'label'=> $langs->trans('DetailRefusCP'),'name'=>"detail_refuse",'size'=>"50",'value'=>"")); - $ret=$form->form_confirm("fiche.php?id=".$id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0); + print $form->formconfirm("fiche.php?id=".$id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0); if ($ret == 'html') print '<br />'; } // Si annulation de la demande if ($action == 'cancel' && $cp->statut == 2 && ($user->id == $cp->fk_validator || $user->id == $cp->fk_user)) { - $ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1); + print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1); if ($ret == 'html') print '<br />'; } diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index f2681a936f7..efe15744079 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -481,8 +481,8 @@ if ($step == 3 && $datatoimport) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); + } print '<table width="100%" class="border">'; diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 6e4d8e72a7b..ab455616d74 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -490,8 +490,8 @@ else if ($action == 'delete') { $expedition_id = $_GET["expid"]; - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1); + } /* @@ -500,8 +500,8 @@ else */ if ($action == 'valid') { - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$delivery->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm",$delivery->ref),'confirm_valid','','',1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm",$delivery->ref),'confirm_valid','','',1); + } diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 644c321b8bb..0cca7dee679 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -157,7 +157,6 @@ $productstatic = new Product($db); $form = new Form($db); llxHeader("","",$langs->trans("CardProduct".$product->type)); -$form = new Form($db); dol_htmloutput_errors($mesg); diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php index 6710ed5b0f1..c3353866b29 100644 --- a/htdocs/product/photos.php +++ b/htdocs/product/photos.php @@ -96,8 +96,8 @@ if ($object->id) */ if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); + } print($mesg); diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index db8dbc6de1b..c98c6c23e96 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -240,9 +240,7 @@ else // Confirm delete third party if ($action == 'delete') { - $form = new Form($db); - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$object->libelle),"confirm_delete",'',0,2); - if ($ret == 'html') print '<br>'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$object->libelle),"confirm_delete",'',0,2); } print '<table class="border" width="100%">'; diff --git a/htdocs/societe/notify/fiche.php b/htdocs/societe/notify/fiche.php index a0ab078e315..04210617d3d 100644 --- a/htdocs/societe/notify/fiche.php +++ b/htdocs/societe/notify/fiche.php @@ -130,10 +130,8 @@ $result=$object->fetch($socid); if ($result > 0) { - $form = new Form($db); $langs->load("other"); - $head = societe_prepare_head($object); dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company'); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 4b0b480ac68..82a79db9d2f 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -871,7 +871,6 @@ else if ($j % 2 == 1) print '<td colspan="2"></td></tr>'; // Assujeti TVA - $form = new Form($db); print '<tr><td>'.$langs->trans('VATIsUsed').'</td>'; print '<td>'; print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation @@ -1593,7 +1592,6 @@ else if ($j % 2 == 1) print '<td colspan="2"></td></tr>'; // VAT payers - $form = new Form($db); print '<tr><td>'; print $langs->trans('VATIsUsed'); print '</td><td>'; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 5d50022c592..a66d6108d5f 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -82,7 +82,6 @@ $langs->load("users"); $langs->load("companies"); $langs->load("ldap"); -$form = new Form($db); $object = new User($db); $extrafields = new ExtraFields($db); @@ -566,10 +565,10 @@ if ($action == 'adduserldap') * View */ -llxHeader('',$langs->trans("UserCard")); - $form = new Form($db); +llxHeader('',$langs->trans("UserCard")); + if (($action == 'create') || ($action == 'adduserldap')) { /* ************************************************************************** */ @@ -1404,7 +1403,6 @@ else if ($caneditgroup) { - $form = new Form($db); print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">'."\n"; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'; print '<input type="hidden" name="action" value="addgroup" />'; -- GitLab