diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 87412802de0a24a0468652ce61c88499acf50994..275e9323223036dabc1ecd8a419481df05154043 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 d0615896cc604efe43b86a21bd8ec5b2be9349b5..330bedf486267256398deb74a246eeff47df5309 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 302cb524f2a559a2debca01b6e493dc750fa822c..e3bbe5b55a9bb8ffbe7b1cb71e6c3c9fa1e95993 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 d221619acf48fffa17da7177d399812023cc05ce..7dd82f9a6a584d350bb9c8a2133ea44f49beb940 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 66f8d3afaaffca0a325fbc66bda3debf34145fdd..94c660c9a3ff7c47817a4e2a4bad92f5287c8016 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 9397b6cd28cb9e7c198e3490ffe873e1f13d3293..7aeb6eb9f782ad19cafb4bd1f2ae9a6d3f1a3307 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 45df64a5355007f8bba7bde023b0e0ddc817a8f3..cfaa0c72004c5a9a16b6427c88bfd80d1dd3642f 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 9dc1aef46b29d3b7d2bd5e837c47d48e52a6d7f7..955d02b50f999c0ea1badd32ff24ef4f4ddcbee6 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 b5d23ed8740b7270383bca6697f55e983eda12dd..d43c4df9a3da5f2ab27aad7bce5ef93f21328aa2 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 f5409681be84527bead93c2631074987f3ee9cc0..9021ad0acaf354a6af722157201aaf6028c07d94 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 cfa83e78875450e28e00edda2b108cc0bfa1f27f..0de58ca2ed06aa97aac08bcf0c3bfcfd3357c7c1 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 1d599ee549dd832e1f9ae09618fc5c4e70884f9e..61ad0aac194fdc4bea3cc1418ea221a42bfa1f5f 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 d4da7ec74ac0a6adefe3569e5b326b6ccf8d8164..888126a19f9a03b4a2f40c24eac2d111b26b9abd 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 dbe67212f370c1b93918c81c19a806d7a3a99833..f27cef41cb48f83caf01f8f01586966ad335fb68 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 407a5398dc519b61bd6b6ef6b0bb1cc7c6e0e6ec..ba6f6ea62ec53fc899e55a69c3143f0d90ec3ed0 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 dcad7cd4f222479e7a073f2f5d643a34378b4fc3..ef57d15d355d8dc9199ed10f04f6234065db0466 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 9b07bccd7aeeffe6348270fb201d74d7de08dddc..26cdf746f461f160df9aca400ac743ed562c7a8d 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 e82d962053d8ec817ef815610a9ed6191ec4b396..808d9163222b9d9d6fb48db0d55c89392817bb64 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 5671f4f8d9cd96db8f17e1ddfcae786a2a86f56a..8aae07746e957d1cb8984781d506b5ba00d8e525 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 e93113e028c8559594cef238f941464fc1450274..d7e9b4f09469e9eb15479379ff6f64ed828d5b16 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 9f16508c590fdcc95de33fe73b3f104819a4e042..cf7d70819fccda3464130d75b6a5831adf155ff9 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 0ad3eaf862255a1838c2919be7b3481c56e948f7..d502e6e2fc07461afacf39edcbd3a0d7154a9d6e 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 22af3b3548d9daa01740ff29324ce3069534ac22..5db8e38d91202721385067fa1cc6b75bce89ca7c 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 7f587500cbed5c17090af56b755db52fb96fd79a..a4389294fb19171166c576f8ca29120f96012e56 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 099befedb95f61be108ab6e5739a33d602a632e8..1dba64f57d73276cf1fb13da3d801b89d53205f0 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 30aced500d77654a8375e54c197c1eaaaeeb1e0a..f096cac29c742c3b065e4b72786ecb78d13fd8b5 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 f114f0c91cd24d9a291dd1560036369483565be1..81e0ba99f26cd155a08d3756ee2722784bd7f246 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 1591c35d26a73a3938aa11efabdcae3fe8f1b6f2..7c391558cb98e640df7b74f39a6088cf4ec12d52 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 5ab21beed0d6691d465f9cd9c839404b465ccc05..ec16acdbc162cd60c12308a893194d2be9f835aa 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 afb03ab867eb3cb570cad507fd80730b5867b986..6b9dcc7d1a1b82802cefaf4a904010b35207d25d 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 8ba84f6fc76ca6baa42b674b5601f37115645310..94c5d06759d65d601b0c0c6153b429c647af603d 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 4c618c79e71c01c15862ae3e4f9518b41660302f..b74af256bc32fe59c7c95b0b80e8d216d2b179ac 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 bb8844eafc692f85e77377caec0cbe03e6c203cf..85eddf4762420b014baa9fbffd0b8152ad912b6d 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 8f466aa377f2dd11bae2d079635d4be8c15156fe..78db51c9620bf235e17ae6dd73e2db67dc9800a6 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 24f4bf73b0ad25939a090816d854e174c7c3a02b..1e09cd474829760b13f138b4d9e5a0af85ad6e77 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 98397ebe6c18cb69e1dbb5ce1bd9aa60b61e7ce4..99ebd02c094317fac238b6d815f11baf374baf29 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 b9d70300c805da3e61fc1423594721c63e4587a0..30349e5bc09f22775a68a3ad82755b34d92b1a67 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 d3947958450e3f05ac4dbaeb763220b0652057f6..1ec1fe22c3d4671f4d1969d29104d288889ef901 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 d1fdaeb113eddd42a8267efc6004590851aec816..da72a325574347ce4db818d51b1a4a789bd1f6e4 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 77a7cce4e23e769cedfd9776f40aac00cc0d1d2a..68467939a106d44c9cfdb6fb72df0297955c6359 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 56b8f78762fa4d89cdfffcd8b2bc99d1d1bbad21..8ba991076f1ff4db82f956074f43c2428cdabdd2 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 1ee145b61fbc641a8ba88115414b5462f53b53cc..4fe504870cb98d2e680e4f761e138b5f64b46672 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 30afab7e935d60c4b6351af5207a7dd9a73df452..f622a305ac129e6a1a350ca9892a20091ceb76c0 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 e8416621de65bd6bd056423d9c83e95d2fbd2e45..9c4f2cfffef5be2b10ed54c8bab4b58ff994379b 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 a65df53706d6581e2f062337c1a34151992a0a8a..8176a80938c6ee25d014b2c660617a2bb31b969f 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 f2681a936f7a20ac259b4e7263ad751856179e9e..efe1574407976c505aa95052758b251b0a27cc19 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 6e4d8e72a7bbf1b03b7a581a402296014dde5daf..ab455616d746f7aae614389000cea0bde09cbd27 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 644c321b8bb69ea41f7327bc85484cbc5f882600..0cca7dee67960c83be121db658ed0e913476a182 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 6710ed5b0f10369056499c5f44a6a600a77c1950..c3353866b2978758253da6510b606aece7be5426 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 db8dbc6de1be0f1cc66996f06a75ba2abc950b0f..c98c6c23e966fd208135078c2a2be5723c93e9af 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 a0ab078e315ae76aef0b88d7c89c767580002e5b..04210617d3ddc963cb73c67250d1269f311f0c6b 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 4b0b480ac68f7be35e173f6bf8d6f6d3c63d7bc5..82a79db9d2fe5ec6991a87b4756df4c503289ec0 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 5d50022c59220ff767c2c5a394acb4b6b9d08fc5..a66d6108d5faac150e91dbf7be29b8affa3ac7e0 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" />';