Revert a bad PR. if form_confirm is replaced with formconfirm, we must

include a print before. It is no more included into function.
This commit is contained in:
Laurent Destailleur 2015-10-17 02:01:13 +02:00
parent 7fd6d8839a
commit 8c66a7d099
6 changed files with 21 additions and 21 deletions

View File

@ -200,7 +200,7 @@ if ($id > 0 || !empty($ref)) {
* Confirmation suppression fichier * Confirmation suppression fichier
*/ */
if ($action == 'delete') { if ($action == 'delete') {
$ret = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]), $ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]),
$langs->trans('DeleteFile'), $langs->trans('DeleteFile'),
$langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile',
'', 0, 1); '', 0, 1);

View File

@ -1635,7 +1635,7 @@ else
'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"),
array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid));
$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion); $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion);
print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>'; print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>';
} }
@ -1647,7 +1647,7 @@ else
$dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
$comment = GETPOST('comment'); $comment = GETPOST('comment');
$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1); $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1);
print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>'; print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>';
} }
@ -1659,7 +1659,7 @@ else
$dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
$comment = GETPOST('comment'); $comment = GETPOST('comment');
$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1);
print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>'; print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>';
} }

View File

@ -3238,7 +3238,7 @@ class Form
$formconfirm.= ($question ? '<div class="confirmmessage">'.img_help('','').' '.$question . '</div>': ''); $formconfirm.= ($question ? '<div class="confirmmessage">'.img_help('','').' '.$question . '</div>': '');
$formconfirm.= '</div>'."\n"; $formconfirm.= '</div>'."\n";
$formconfirm.= "\n<!-- begin ajax formconfirm page=".$page." -->\n"; $formconfirm.= "\n<!-- begin ajax form_confirm page=".$page." -->\n";
$formconfirm.= '<script type="text/javascript">'."\n"; $formconfirm.= '<script type="text/javascript">'."\n";
$formconfirm.= 'jQuery(document).ready(function() { $formconfirm.= 'jQuery(document).ready(function() {
$(function() { $(function() {
@ -3309,11 +3309,11 @@ class Form
}); });
}); });
</script>'; </script>';
$formconfirm.= "<!-- end ajax formconfirm -->\n"; $formconfirm.= "<!-- end ajax form_confirm -->\n";
} }
else else
{ {
$formconfirm.= "\n<!-- begin formconfirm page=".$page." -->\n"; $formconfirm.= "\n<!-- begin form_confirm page=".$page." -->\n";
$formconfirm.= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; $formconfirm.= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
$formconfirm.= '<input type="hidden" name="action" value="'.$action.'">'."\n"; $formconfirm.= '<input type="hidden" name="action" value="'.$action.'">'."\n";
@ -3346,7 +3346,7 @@ class Form
$formconfirm.= "</form>\n"; $formconfirm.= "</form>\n";
$formconfirm.= '<br>'; $formconfirm.= '<br>';
$formconfirm.= "<!-- end formconfirm -->\n"; $formconfirm.= "<!-- end form_confirm -->\n";
} }
return $formconfirm; return $formconfirm;

View File

@ -28,7 +28,7 @@ if (empty($relativepathwithnofile)) $relativepathwithnofile='';
if ($action == 'delete') if ($action == 'delete')
{ {
$langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles
$ret = $form->formconfirm( $ret = $form->form_confirm(
$_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param),
$langs->trans('DeleteFile'), $langs->trans('DeleteFile'),
$langs->trans('ConfirmDeleteFile'), $langs->trans('ConfirmDeleteFile'),

View File

@ -1321,56 +1321,56 @@ else
if ($action == 'save') if ($action == 'save')
{ {
$ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($action == 'save_from_refuse') if ($action == 'save_from_refuse')
{ {
$ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($action == 'validate') if ($action == 'validate')
{ {
$ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($action == 'paid') if ($action == 'paid')
{ {
$ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($action == 'cancel') if ($action == 'cancel')
{ {
$array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_cancel",'size'=>"50",'value'=>"")); $array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_cancel",'size'=>"50",'value'=>""));
$ret=$form->formconfirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Cancel"),"","confirm_cancel",$array_input,"",1); $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Cancel"),"","confirm_cancel",$array_input,"",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($action == 'brouillonner'): if ($action == 'brouillonner'):
$ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
endif; endif;
if ($action == 'refuse') // Deny if ($action == 'refuse') // Deny
{ {
$array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_refuse",'size'=>"50",'value'=>"")); $array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_refuse",'size'=>"50",'value'=>""));
$ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($action == 'delete_line') if ($action == 'delete_line')
{ {
$ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid'),$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid'),$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -108,13 +108,13 @@ dol_fiche_head('');
if ($_GET["action"] == 'ndfTOaccount'): if ($_GET["action"] == 'ndfTOaccount'):
$idTrip = $_GET['idTrip']; $idTrip = $_GET['idTrip'];
$ret=$html->formconfirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("ndfToAccount"),$langs->trans("ConfirmNdfToAccount"),"confirm_ndf_to_account","","",1); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("ndfToAccount"),$langs->trans("ConfirmNdfToAccount"),"confirm_ndf_to_account","","",1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
endif; endif;
if ($_GET["action"] == 'accountTOndf'): if ($_GET["action"] == 'accountTOndf'):
$idTrip = $_GET['idTrip']; $idTrip = $_GET['idTrip'];
$ret=$html->formconfirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("AccountToNdf"),$langs->trans("ConfirmAccountToNdf"),"confirm_account_to_ndf","","",1); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("AccountToNdf"),$langs->trans("ConfirmAccountToNdf"),"confirm_account_to_ndf","","",1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
endif; endif;