Qual: Remplacer de code dupliqu sur la demande de confirmation par la mthode commune html->form_confirm
This commit is contained in:
parent
0c6353232c
commit
ed1da00f62
@ -99,22 +99,8 @@ else
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
|
||||
print '<form method="post" action="fiche.php?id='.$id.'">';
|
||||
print '<input type="hidden" name="action" value="confirm_delete">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<tr><td colspan="3">Supprimer un auteur</td></tr>';
|
||||
|
||||
print '<tr><td class="delete">Etes-vous sur de vouloir supprimer cet auteur ?</td><td class="delete">';
|
||||
$htmls = new Form($db);
|
||||
|
||||
$htmls->selectyesno("confirm","no");
|
||||
|
||||
print "</td>\n";
|
||||
print '<td class="delete" align="center"><input type="submit" value="Confirmer"</td></tr>';
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
$htmls->form_confirm("fiche.php?id=$id","Supprimer un auteur","Etes-vous sur de vouloir supprimer cet auteur ?","confirm_delete");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -130,11 +116,10 @@ else
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">Nom</td><td><input name="nom" size="40" value="'.$auteur->nom.'"></td>';
|
||||
|
||||
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("Save").'"> <input type="submit" value="'.$langs->trans("Cancel").'" name="cancel"></td></tr>';
|
||||
|
||||
print '</form>';
|
||||
@ -145,7 +130,7 @@ else
|
||||
|
||||
print '<div class="titre">Fiche Auteur : '.$auteur->nom.'</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">Nom</td><td width="80%">'.$auteur->nom.'</td></tr>';
|
||||
|
||||
|
||||
@ -96,22 +96,8 @@ else
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
|
||||
print '<form method="post" action="fiche.php?id='.$id.'">';
|
||||
print '<input type="hidden" name="action" value="confirm_delete">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<tr><td colspan="3">Supprimer un éditeur</td></tr>';
|
||||
|
||||
print '<tr><td class="delete">Etes-vous sur de vouloir supprimer cet éditeur ?</td><td class="delete">';
|
||||
$htmls = new Form($db);
|
||||
|
||||
$htmls->selectyesno("confirm","no");
|
||||
|
||||
print "</td>\n";
|
||||
print '<td class="delete" align="center"><input type="submit" value="Confirmer"</td></tr>';
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
$htmls->form_confirm("fiche.php?id=$id","Supprimer un éditeur","Etes-vous sur de vouloir supprimer cet éditeur ?","confirm_delete");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -119,7 +105,6 @@ else
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<div class="titre">Edition de la fiche Editeur : '.$editeur->titre.'</div><br>';
|
||||
@ -127,11 +112,10 @@ else
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">Nom</td><td width="80%"><input name="nom" size="40" value="'.$editeur->nom.'"></td>';
|
||||
|
||||
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("Save").'"> <input type="submit" value="'.$langs->trans("Cancel").'" name="cancel"></td></tr>';
|
||||
|
||||
print '</form>';
|
||||
@ -142,7 +126,7 @@ else
|
||||
|
||||
print '<div class="titre">Fiche Editeur : '.$editeur->titre.'</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">Nom</td><td width="80%">'.$editeur->nom.'</td></tr>';
|
||||
|
||||
|
||||
@ -222,25 +222,11 @@ else
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
|
||||
print '<form method="post" action="fiche.php?id='.$id.'">';
|
||||
print '<input type="hidden" name="action" value="confirm_delete">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<tr><td colspan="3">Supprimer le livre</td></tr>';
|
||||
print '<tr><td class="delete">Etes-vous sur de vouloir supprimer cet ouvrage ?</td><td class="delete">';
|
||||
$htmls = new Form($db);
|
||||
|
||||
$htmls->selectyesno("confirm","no");
|
||||
|
||||
print "</td>\n";
|
||||
print '<td class="delete" align="center"><input type="submit" value="Confirmer"</td></tr>';
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
$htmls->form_confirm("fiche.php?id=$id","Supprimer un ouvrage","Etes-vous sur de vouloir supprimer cet ouvrage ?","confirm_delete");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<div class="titre">Edition de la fiche Livre : '.$livre->titre.'</div><br>';
|
||||
@ -248,7 +234,7 @@ else
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td><input name="ref" size="20" value="'.$livre->ref.'"></td>';
|
||||
print '<td valign="top">'.$langs->trans("Description").'</td></tr>';
|
||||
@ -347,7 +333,7 @@ else
|
||||
|
||||
print '<div class="titre">Fiche Livre : '.$livre->titre.'</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td width="20%">'.$livre->ref.'</td>';
|
||||
print '<td width="50%" valign="top">'.$langs->trans("Description").'</td>';
|
||||
|
||||
@ -118,25 +118,10 @@ else
|
||||
* Confirmation de la suppression de la newsletter
|
||||
*
|
||||
*/
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
|
||||
print '<form method="post" action="fiche.php?id='.$id.'">';
|
||||
print '<input type="hidden" name="action" value="confirm_delete">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<tr><td colspan="3">Supprimer un éditeur</td></tr>';
|
||||
|
||||
print '<tr><td class="delete">Etes-vous sur de vouloir supprimer cette newsletter ?</td><td class="delete">';
|
||||
$htmls = new Form($db);
|
||||
|
||||
$htmls->selectyesno("confirm","no");
|
||||
|
||||
print "</td>\n";
|
||||
print '<td class="delete" align="center"><input type="submit" value="Confirmer"</td></tr>';
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
$htmls->form_confirm("fiche.php?id=$id","Supprimer une newsletter","Etes-vous sur de vouloir supprimer cet newsletter ?","confirm_delete");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -146,9 +131,7 @@ else
|
||||
if ($action == 'valid')
|
||||
{
|
||||
$htmls = new Form($db);
|
||||
$htmls->form_confirm('fiche.php?id='.$id,
|
||||
"Valider une newsletter",
|
||||
"Etes-vous sûr de vouloir valider cette newsletter ?");
|
||||
$htmls->form_confirm('fiche.php?id='.$id,"Valider une newsletter","Etes-vous sûr de vouloir valider cette newsletter ?");
|
||||
}
|
||||
/*
|
||||
*
|
||||
@ -159,7 +142,7 @@ else
|
||||
|
||||
print '<form method="post" action="fiche.php?id='.$id.'">';
|
||||
print '<input type="hidden" name="action" value="confirm_send">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td colspan="3">Envoi de newsletter</td></tr>';
|
||||
|
||||
@ -187,7 +170,7 @@ else
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border">';
|
||||
|
||||
print '<tr><td>Emetteur nom</td><td><input name="email_from_name" size="30" value="'.$newsletter->email_from_name.'"></td></tr>';
|
||||
print '<tr><td>Emetteur email</td><td><input name="email_from_email" size="40" value="'.$newsletter->email_from_email.'"></td></tr>';
|
||||
@ -214,7 +197,7 @@ else
|
||||
|
||||
print '<div class="titre">Fiche Newsletter : '.$newsletter->titre.'</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">Emetteur nom</td><td>'.$newsletter->email_from_name.'</td></tr>';
|
||||
print '<tr><td width="20%">Emetteur email</td><td>'.$newsletter->email_from_email.'</td></tr>';
|
||||
@ -227,7 +210,7 @@ else
|
||||
if ($newsletter->status == 3)
|
||||
{
|
||||
print "<br />";
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">Début de l\'envoi</td><td width="30%">'.strftime("%d %B %Y %H:%M:%S",$newsletter->date_send_begin).'</td>';
|
||||
print '<td width="20%">Nombre de mails envoyés</td><td width="30%">'.$newsletter->nbsent.'</td></tr>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user