Qual: Use a so much simpler way to have ajax confirmation boxes

This commit is contained in:
Laurent Destailleur 2009-05-06 13:39:43 +00:00
parent db61b68e9e
commit 7c6016b355
46 changed files with 1160 additions and 1328 deletions

View File

@ -851,8 +851,8 @@ if ($rowid && $action != 'edit')
$formquestion=array( $formquestion=array(
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login)); array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login));
$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateLogin"),"confirm_create_user",$formquestion); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateLogin"),"confirm_create_user",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm create third party // Confirm create third party
@ -874,15 +874,15 @@ if ($rowid && $action != 'edit')
$formquestion=array( $formquestion=array(
array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name));
$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm remove member // Confirm remove member
if ($action == 'delete') if ($action == 'delete')
{ {
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete"); $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm validate member // Confirm validate member
@ -892,15 +892,15 @@ if ($rowid && $action != 'edit')
$formquestion=array(); $formquestion=array();
if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $langs->trans("SendAnEMailToMember",$adh->email), 'value' => 'true'); if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $langs->trans("SendAnEMailToMember",$adh->email), 'value' => 'true');
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion); $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm send card by mail // Confirm send card by mail
if ($action == 'sendinfo') if ($action == 'sendinfo')
{ {
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail"),"confirm_sendinfo"); $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail"),"confirm_sendinfo");
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm resiliate // Confirm resiliate
@ -915,8 +915,8 @@ if ($rowid && $action != 'edit')
$label.=')'; $label.=')';
if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?'true':'false')); if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?'true':'false'));
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion); $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -924,8 +924,8 @@ if ($rowid && $action != 'edit')
*/ */
if ($action == 'add_spip') if ($action == 'add_spip')
{ {
$html->form_confirm("fiche.php?rowid=$rowid","Ajouter dans spip","Etes-vous sur de vouloir ajouter cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_add_spip"); $ret=$html->form_confirm("fiche.php?rowid=$rowid","Ajouter dans spip","Etes-vous sur de vouloir ajouter cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_add_spip");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -933,8 +933,8 @@ if ($rowid && $action != 'edit')
*/ */
if ($action == 'del_spip') if ($action == 'del_spip')
{ {
$html->form_confirm("fiche.php?rowid=$rowid","Supprimer dans spip","Etes-vous sur de vouloir effacer cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_del_spip"); $ret=$html->form_confirm("fiche.php?rowid=$rowid","Supprimer dans spip","Etes-vous sur de vouloir effacer cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_del_spip");
print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -297,8 +297,8 @@ if ($rowid && $action != 'edit')
//$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>'; //$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
$text=$langs->trans("ConfirmDeleteSubscription"); $text=$langs->trans("ConfirmDeleteSubscription");
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord");
$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';

View File

@ -35,7 +35,7 @@ $langs->load("admin");
$langs->load("companies"); $langs->load("companies");
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
$acts[0] = "activate"; $acts[0] = "activate";
$acts[1] = "disable"; $acts[1] = "disable";
@ -440,18 +440,17 @@ if (empty($_GET["id"]))
print $langs->trans("DictionnaryDesc"); print $langs->trans("DictionnaryDesc");
print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n"; print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
} }
print "<br>\n"; print "<br>\n";
/* /*
* Confirmation de la suppression de la ligne * Confirmation de la suppression de la ligne
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html = new Form($db); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$_GET["rowid"].'&amp;code='.$_GET["code"].'&amp;id='.$_GET["id"], $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete');
$html->form_confirm($_SERVER["PHP_SELF"].'?sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$_GET["rowid"].'&amp;code='.$_GET["code"].'&amp;id='.$_GET["id"], $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete'); if ($ret == 'html') print '<br>';
print '<br>'; }
}
/* /*
* Affichage d'un dictionnaire particulier * Affichage d'un dictionnaire particulier
@ -495,7 +494,7 @@ if ($_GET["id"])
$var=false; $var=false;
$fieldlist=split(',',$tabfield[$_GET["id"]]); $fieldlist=split(',',$tabfield[$_GET["id"]]);
// print '<table class="noborder" width="100%">'; // print '<table class="noborder" width="100%">';
// Ligne de titre d'ajout // Ligne de titre d'ajout
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -531,8 +530,9 @@ if ($_GET["id"])
if ($fieldlist[$field]=='libelle') $alabelisused=1; if ($fieldlist[$field]=='libelle') $alabelisused=1;
} }
print '<td colspan="3">&nbsp;</td>'; print '<td colspan="3">';
print '<input type="hidden" name="id" value="'.$_GET["id"].'">'; print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
print '&nbsp;</td>';
print '</tr>'; print '</tr>';
// Ligne d'ajout // Ligne d'ajout
@ -718,7 +718,7 @@ llxFooter('$Date$ - $Revision$');
/** /**
\brief Affiche les champs \brief Affiche les champs
*/ */
function fieldList($fieldlist,$obj='') function fieldList($fieldlist,$obj='')
{ {
global $conf,$langs,$db; global $conf,$langs,$db;

View File

@ -242,9 +242,8 @@ if ($_GET["action"] == 'delete')
$result = $db->query($sql); $result = $db->query($sql);
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$html = new Form($db); $ret=$html->form_confirm("index.php?menu_handler=".$menu_handler."&menuId=".$_GET['menuId'],$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete");
$html->form_confirm("index.php?menu_handler=".$menu_handler."&menuId=".$_GET['menuId'],$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete"); if ($ret == 'html') print '<br>';
print "<br>\n";
} }

View File

@ -102,8 +102,8 @@ if ($result)
if ($_GET["action"] == 'purge') if ($_GET["action"] == 'purge')
{ {
$form->form_confirm($_SERVER["PHP_SELF"], $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'), 'confirm_purge'); $ret=$form->form_confirm($_SERVER["PHP_SELF"], $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'), 'confirm_purge');
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';

View File

@ -100,8 +100,8 @@ dol_fiche_head($head, 'card', $title);
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$c->id.'&amp;type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$c->id.'&amp;type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
print '<table border="0" width="100%" class="border">'; print '<table border="0" width="100%" class="border">';

View File

@ -643,8 +643,8 @@ if ($_GET["id"])
// Confirmation suppression action // Confirmation suppression action
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete"); $ret=$html->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($_REQUEST["action"] == 'edit') if ($_REQUEST["action"] == 'edit')

View File

@ -383,8 +383,8 @@ else
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html = new Form($db); $html = new Form($db);
$html->form_confirm("adresse_livraison.php?socid=".$livraison->socid."&amp;idl=".$_GET["idl"],$langs->trans("DeleteDeliveryAddress"),$langs->trans("ConfirmDeleteDeliveryAdress"),"confirm_delete"); $ret=$html->form_confirm("adresse_livraison.php?socid=".$livraison->socid."&amp;idl=".$_GET["idl"],$langs->trans("DeleteDeliveryAddress"),$langs->trans("ConfirmDeleteDeliveryAdress"),"confirm_delete");
print "<br />\n"; if ($ret == 'html') print '<br>';
} }
if ($livraison->error) if ($livraison->error)

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/mailing/mailing.class.php';
$langs->load("mails"); $langs->load("mails");
if (! $user->rights->mailing->lire || $user->societe_id > 0) if (! $user->rights->mailing->lire || $user->societe_id > 0)
accessforbidden(); accessforbidden();
$message = ''; $message = '';
@ -516,32 +516,32 @@ else
$head[$h][1] = $langs->trans('MailRecipients'); $head[$h][1] = $langs->trans('MailRecipients');
$h++; $h++;
/* /*
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$mil->id; $head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$mil->id;
$head[$h][1] = $langs->trans("MailHistory"); $head[$h][1] = $langs->trans("MailHistory");
$h++; $h++;
*/ */
dol_fiche_head($head, $hselected, $langs->trans("Mailing")); dol_fiche_head($head, $hselected, $langs->trans("Mailing"));
// Confirmation de la validation du mailing // Confirmation de la validation du mailing
if ($_GET["action"] == 'valide') if ($_GET["action"] == 'valide')
{ {
$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valide"); $ret=$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valide");
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm reset // Confirm reset
if ($_GET["action"] == 'reset') if ($_GET["action"] == 'reset')
{ {
$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$mil->ref),"confirm_reset"); $ret=$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$mil->ref),"confirm_reset");
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm delete // Confirm delete
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete"); $ret=$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
@ -565,8 +565,8 @@ else
else else
{ {
$text=$langs->trans('ConfirmSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB); $text=$langs->trans('ConfirmSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$_REQUEST['id'],$langs->trans('SendMailing'),$text,'sendallconfirmed'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$_REQUEST['id'],$langs->trans('SendMailing'),$text,'sendallconfirmed');
print '<br />'; if ($ret == 'html') print '<br>';
} }
} }

View File

@ -916,8 +916,8 @@ if ($id > 0 || ! empty($ref))
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$propal->ref),'confirm_clone',$formquestion,'yes'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$propal->ref),'confirm_clone',$formquestion,'yes');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -925,8 +925,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp'), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -934,8 +934,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -943,8 +943,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'validate') if ($_GET['action'] == 'validate')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('ValidateProp'), $langs->trans('ConfirmValidateProp'), 'confirm_validate'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('ValidateProp'), $langs->trans('ConfirmValidateProp'), 'confirm_validate');
print '<br>'; if ($ret == 'html') print '<br>';
} }
@ -1459,17 +1459,9 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '<td align="center">'; print '<td align="center">';
if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&lineid='.$objp->rowid.'&action=confirm_deleteline&confirm=yes';
print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteProductLine').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'deleteline'.$i.'\')">';
}
else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=ask_deleteline&amp;lineid='.$objp->rowid.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=ask_deleteline&amp;lineid='.$objp->rowid.'">';
} }
}
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=deleteline&amp;lineid='.$objp->rowid.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=deleteline&amp;lineid='.$objp->rowid.'">';
@ -1763,16 +1755,7 @@ if ($id > 0 || ! empty($ref))
// Valid // Valid
if ($propal->statut == 0 && $user->rights->propale->valider) if ($propal->statut == 0 && $user->rights->propale->valider)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=validate"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&action=confirm_validate&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateProp')).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=validate"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
@ -1821,16 +1804,7 @@ if ($id > 0 || ! empty($ref))
// Delete // Delete
if ($user->rights->propale->supprimer) if ($user->rights->propale->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=delete"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&action=confirm_delete&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteProp').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>'; print '>'.$langs->trans('Delete').'</a>';
} }

View File

@ -1203,8 +1203,8 @@ else
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1225,7 +1225,7 @@ else
$text=$langs->trans('ConfirmValidateOrder',$num); $text=$langs->trans('ConfirmValidateOrder',$num);
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_validate'); $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_validate');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1233,8 +1233,8 @@ else
*/ */
if ($_GET['action'] == 'close') if ($_GET['action'] == 'close')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1242,8 +1242,8 @@ else
*/ */
if ($_GET['action'] == 'cancel') if ($_GET['action'] == 'cancel')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1251,8 +1251,8 @@ else
*/ */
if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation
@ -1264,8 +1264,8 @@ else
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$commande->ref),'confirm_clone',$formquestion,'yes'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$commande->ref),'confirm_clone',$formquestion,'yes');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1637,17 +1637,9 @@ else
print '</td>'; print '</td>';
print '<td align="center">'; print '<td align="center">';
if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$id.'&lineid='.$objp->rowid.'&action=confirm_deleteline&confirm=yes';
print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmDeleteProductLine')).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'deleteline'.$i.'\')">';
}
else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&amp;action=ask_deleteline&amp;lineid='.$objp->rowid.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&amp;action=ask_deleteline&amp;lineid='.$objp->rowid.'">';
} }
}
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&amp;action=deleteline&amp;lineid='.$objp->rowid.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&amp;action=deleteline&amp;lineid='.$objp->rowid.'">';
@ -1929,26 +1921,7 @@ else
// Valid // Valid
if ($commande->statut == 0 && $commande->total_ttc >= 0 && $numlines > 0 && $user->rights->commande->valider) if ($commande->statut == 0 && $commande->total_ttc >= 0 && $numlines > 0 && $user->rights->commande->valider)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=validate"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
// on verifie si la commande est en numerotation provisoire
$ref = substr($commande->ref, 1, 4);
if ($ref == 'PROV')
{
$num = $commande->getNextNumRef($soc);
}
else
{
$num = $commande->ref;
}
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_validate&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateOrder',$num)).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=validate"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
@ -2004,16 +1977,7 @@ else
{ {
if ($user->rights->commande->cloturer) if ($user->rights->commande->cloturer)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=close"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_close&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmCloseOrder')).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'close\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=close"';
}
print '>'.$langs->trans('Close').'</a>'; print '>'.$langs->trans('Close').'</a>';
} }
} }
@ -2024,16 +1988,7 @@ else
$nb_expedition = $commande->nb_expedition(); $nb_expedition = $commande->nb_expedition();
if ($user->rights->commande->annuler && $nb_expedition == 0) if ($user->rights->commande->annuler && $nb_expedition == 0)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=cancel"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_cancel&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmCancelOrder')).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'cancel\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=cancel"';
}
print '>'.$langs->trans('CancelOrder').'</a>'; print '>'.$langs->trans('CancelOrder').'</a>';
} }
} }
@ -2047,16 +2002,7 @@ else
// Delete order // Delete order
if ($user->rights->commande->supprimer) if ($user->rights->commande->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=delete"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_delete&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmDeleteOrder')).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'delete\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>'; print '>'.$langs->trans('Delete').'</a>';
} }

View File

@ -313,8 +313,8 @@ if ($account || $_GET["ref"])
if ($_GET["action"]=='delete') if ($_GET["action"]=='delete')
{ {
$text=$langs->trans('ConfirmDeleteTransaction'); $text=$langs->trans('ConfirmDeleteTransaction');
$html->form_confirm($_SERVER['PHP_SELF'].'?account='.$acct->id.'&amp;rowid='.$_GET["rowid"],$langs->trans('DeleteTransaction'),$text,'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?account='.$acct->id.'&amp;rowid='.$_GET["rowid"],$langs->trans('DeleteTransaction'),$text,'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }

View File

@ -127,8 +127,8 @@ if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit')
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Check BBAN // Check BBAN

View File

@ -289,8 +289,8 @@ else
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
print '<br />'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -219,8 +219,8 @@ if ($result)
// Confirmations // Confirmations
if ($_GET["action"] == 'delete_categ') if ($_GET["action"] == 'delete_categ')
{ {
$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&amp;cat1=".$_GET["fk_categ"]."&amp;orig_account=".$orig_account,$langs->trans("RemoveFromRubrique"),$langs->trans("RemoveFromRubriqueConfirm"),"confirm_delete_categ"); $ret=$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&amp;cat1=".$_GET["fk_categ"]."&amp;orig_account=".$orig_account,$langs->trans("RemoveFromRubrique"),$langs->trans("RemoveFromRubriqueConfirm"),"confirm_delete_categ");
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -237,11 +237,8 @@ else
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$ret=$html->form_confirm("fiche.php?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
$html = new Form($db); if ($ret == 'html') print '<br>';
$html->form_confirm("fiche.php?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
print '<br>';
} }
$soc = new Societe($db); $soc = new Societe($db);

View File

@ -2004,16 +2004,16 @@ else
if ($_GET['action'] == 'converttoreduc') if ($_GET['action'] == 'converttoreduc')
{ {
$text=$langs->trans('ConfirmConvertToReduc'); $text=$langs->trans('ConfirmConvertToReduc');
$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('ConvertToReduc'),$text,'confirm_converttoreduc'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('ConvertToReduc'),$text,'confirm_converttoreduc');
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la suppression de la facture // Confirmation de la suppression de la facture
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$text=$langs->trans('ConfirmDeleteBill'); $text=$langs->trans('ConfirmDeleteBill');
$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('DeleteBill'),$text,'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('DeleteBill'),$text,'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation // Confirmation de la validation
@ -2046,15 +2046,15 @@ else
$text.=$notify->confirmMessage(2,$fac->socid); $text.=$notify->confirmMessage(2,$fac->socid);
} }
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ValidateBill'),$text,'confirm_valid'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ValidateBill'),$text,'confirm_valid');
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Confirmation du classement payé // Confirmation du classement payé
if ($_GET['action'] == 'payed' && $resteapayer <= 0) if ($_GET['action'] == 'payed' && $resteapayer <= 0)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedBill',$fac->ref),'confirm_payed'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedBill',$fac->ref),'confirm_payed');
print '<br />'; if ($ret == 'html') print '<br>';
} }
if ($_GET['action'] == 'payed' && $resteapayer > 0) if ($_GET['action'] == 'payed' && $resteapayer > 0)
{ {
@ -2083,8 +2083,8 @@ else
array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100') array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100')
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedPartially',$fac->ref),'confirm_payed_partially',$formquestion); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedPartially',$fac->ref),'confirm_payed_partially',$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation du classement abandonne // Confirmation du classement abandonne
@ -2124,16 +2124,16 @@ else
array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100') array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100')
); );
$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('CancelBill'),$langs->trans('ConfirmCancelBill',$fac->ref),'confirm_canceled',$formquestion); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('CancelBill'),$langs->trans('ConfirmCancelBill',$fac->ref),'confirm_canceled',$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
} }
// Confirmation de la suppression d'une ligne produit // Confirmation de la suppression d'une ligne produit
if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;rowid='.$_GET["rowid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline', '', 'no'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;rowid='.$_GET["rowid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline', '', 'no');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation
@ -2145,8 +2145,8 @@ else
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes');
print '<br>'; if ($ret == 'html') print '<br>';
} }
@ -3182,19 +3182,7 @@ else
{ {
if ($user->rights->facture->valider) if ($user->rights->facture->valider)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=valid"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
// We check if number is temporary number
if (eregi('^\(PROV',$fac->ref)) $num = $fac->getNextNumRef($soc);
else $num = $fac->ref;
$url = $_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=confirm_valid&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateBill',$num)).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=valid"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
} }

View File

@ -470,10 +470,9 @@ if ($_GET['action'] == 'create' || $_POST['action'] == 'confirm_paiement' || $_P
if ($_POST["action"] == 'add_paiement') if ($_POST["action"] == 'add_paiement')
{ {
// print '<tr><td colspan="3">'; // print '<tr><td colspan="3">';
print '<br />'; print '<br>';
$text=$langs->trans('ConfirmCustomerPayment',$totalpaiement,$langs->trans("Currency".$conf->monnaie)); $text=$langs->trans('ConfirmCustomerPayment',$totalpaiement,$langs->trans("Currency".$conf->monnaie));
$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion); $html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion);
// print '</td></tr>';
} }
print "</form>\n"; print "</form>\n";

View File

@ -197,8 +197,8 @@ else
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm('fiche.php?id='.$remisecheque->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete'); $ret=$html->form_confirm('fiche.php?id='.$remisecheque->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -207,8 +207,8 @@ else
if ($_GET['action'] == 'valide') if ($_GET['action'] == 'valide')
{ {
$facid = $_GET['facid']; $facid = $_GET['facid'];
$html->form_confirm('fiche.php?id='.$remisecheque->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide'); $ret=$html->form_confirm('fiche.php?id='.$remisecheque->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide');
print '<br>'; if ($ret == 'html') print '<br>';
} }
} }

View File

@ -143,8 +143,8 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"));
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); $ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -153,8 +153,8 @@ if ($_GET['action'] == 'delete')
if ($_GET['action'] == 'valide') if ($_GET['action'] == 'valide')
{ {
$facid = $_GET['facid']; $facid = $_GET['facid'];
$html->form_confirm('fiche.php?id='.$paiement->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); $ret=$html->form_confirm('fiche.php?id='.$paiement->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -150,8 +150,8 @@ if ($_GET["id"])
if ($_GET["action"] == 'credite') if ($_GET["action"] == 'credite')
{ {
$html->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite"); $ret=$html->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite");
print '<br />'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -262,15 +262,15 @@ if ($chid > 0)
if ($_GET["action"] == 'payed') if ($_GET["action"] == 'payed')
{ {
$text=$langs->trans('ConfirmPaySocialContribution'); $text=$langs->trans('ConfirmPaySocialContribution');
$html->form_confirm($_SERVER["PHP_SELF"]."?id=$cha->id&amp;action=confirm_payed",$langs->trans('PaySocialContribution'),$text,"confirm_payed"); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=$cha->id&amp;action=confirm_payed",$langs->trans('PaySocialContribution'),$text,"confirm_payed");
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$text=$langs->trans('ConfirmDeleteSocialContribution'); $text=$langs->trans('ConfirmDeleteSocialContribution');
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$cha->id,$langs->trans('DeleteSocialContribution'),$text,'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$cha->id,$langs->trans('DeleteSocialContribution'),$text,'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
if ($_GET['action'] == 'edit') print "<form name=\"charge\" action=\"charges.php?id=$cha->id&amp;action=update\" method=\"post\">"; if ($_GET['action'] == 'edit') print "<form name=\"charge\" action=\"charges.php?id=$cha->id&amp;action=update\" method=\"post\">";

View File

@ -223,8 +223,8 @@ if ($user->rights->societe->contact->supprimer)
{ {
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete"); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
} }
@ -487,8 +487,8 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
$formquestion=array( $formquestion=array(
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login)); array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login));
$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$contact->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$contact->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -68,7 +68,7 @@ if ($_POST["action"] == 'confirm_active' && $_POST["confirm"] == 'yes' && $user-
} }
} }
if ($_POST["action"] == 'confirm_closeline' && $_POST["confirm"] == 'yes' && $user->rights->contrat->activer) if ($_REQUEST["action"] == 'confirm_closeline' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->activer)
{ {
$contrat = new Contrat($db); $contrat = new Contrat($db);
$contrat->fetch($_GET["id"]); $contrat->fetch($_GET["id"]);
@ -654,8 +654,8 @@ else
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$form->form_confirm("fiche.php?id=$id",$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete"); $ret=$form->form_confirm("fiche.php?id=$id",$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -664,8 +664,8 @@ else
if ($_GET["action"] == 'valid') if ($_GET["action"] == 'valid')
{ {
//$numfa = contrat_get_num($soc); //$numfa = contrat_get_num($soc);
$form->form_confirm("fiche.php?id=$id",$langs->trans("ValidateAContract"),$langs->trans("ConfirmValidateContract"),"confirm_valid"); $ret=$form->form_confirm("fiche.php?id=$id",$langs->trans("ValidateAContract"),$langs->trans("ConfirmValidateContract"),"confirm_valid");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -673,8 +673,8 @@ else
*/ */
if ($_GET["action"] == 'close') if ($_GET["action"] == 'close')
{ {
$form->form_confirm("fiche.php?id=$id",$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close"); $ret=$form->form_confirm("fiche.php?id=$id",$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -991,7 +991,11 @@ else
//print '<br />'; //print '<br />';
$dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
$dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]); $dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&amp;ligne=".$_GET["ligne"]."&amp;date=".$dateactstart."&amp;dateend=".$dateactend,$langs->trans("CloseService"),$langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")),"confirm_closeline"); $page=$_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend;
$title=$langs->trans("CloseService");
$question=$langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y"));
$action="confirm_closeline";
$html->form_confirm($page,$title,$question,$action,'','');
print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
} }

View File

@ -200,8 +200,8 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section') if ($_GET['action'] == 'delete_section')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($mesg) { print $mesg."<br>"; } if ($mesg) { print $mesg."<br>"; }

View File

@ -202,8 +202,8 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section') if ($_GET['action'] == 'delete_section')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($mesg) { print $mesg."<br>"; } if ($mesg) { print $mesg."<br>"; }

View File

@ -340,15 +340,15 @@ if ($mesg) { print '<br>'.$mesg.'<br>'; }
// Confirm remove file // Confirm remove file
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm remove file // Confirm remove file
if ($_GET['action'] == 'delete_dir') if ($_GET['action'] == 'delete_dir')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection'), 'confirm_deletedir'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection'), 'confirm_deletedir');
print '<br>'; if ($ret == 'html') print '<br>';
} }
$formfile=new FormFile($db); $formfile=new FormFile($db);

View File

@ -8,7 +8,7 @@
\brief Main ecm page \brief Main ecm page
\version $Id$ \version $Id$
\author Laurent Destailleur \author Laurent Destailleur
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
@ -38,10 +38,10 @@ $upload_dir = $conf->ecm->dir_output.'/'.$section;
/******************************************************************* /*******************************************************************
* ACTIONS * ACTIONS
* *
* Put here all code to do according to value of "action" parameter * Put here all code to do according to value of "action" parameter
********************************************************************/ ********************************************************************/
// Envoie fichier // Envoie fichier
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
@ -83,10 +83,10 @@ if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
/******************************************************************* /*******************************************************************
* PAGE * PAGE
* *
* Put here all code to do according to value of "action" parameter * Put here all code to do according to value of "action" parameter
********************************************************************/ ********************************************************************/
llxHeader(); llxHeader();
@ -101,12 +101,12 @@ print_fiche_titre($langs->trans("ECMAutoOrg"));
/* /*
* Confirmation de la suppression d'une ligne produit * Confirmation de la suppression d'une ligne produit
*/ */
if ($_GET['action'] == 'delete_file') if ($_GET['action'] == 'delete_file')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Construit liste des fichiers // Construit liste des fichiers

View File

@ -221,8 +221,8 @@ print "<br>\n";
// Confirm remove file // Confirm remove file
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($mesg) { print $mesg."<br>"; } if ($mesg) { print $mesg."<br>"; }
@ -246,8 +246,8 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section') if ($_GET['action'] == 'delete_section')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Construit liste des repertoires // Construit liste des repertoires

View File

@ -150,8 +150,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET["action"] == 'cloture') if ($_GET["action"] == 'cloture')
{ {
$html->form_confirm("commande.php?id=".$_GET["id"],"Cl<EFBFBD>turer la commande","Etes-vous s<>r de vouloir cl<63>turer cette commande ?","confirm_cloture"); $ret=$html->form_confirm("commande.php?id=".$_GET["id"],"Cl<EFBFBD>turer la commande","Etes-vous s<>r de vouloir cl<63>turer cette commande ?","confirm_cloture");
print "<br />"; if ($ret == 'html') print '<br>';
} }
// Onglet commande // Onglet commande

View File

@ -554,8 +554,8 @@ else
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$expedition->ref),'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$expedition->ref),'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -564,8 +564,8 @@ else
*/ */
if ($_GET["action"] == 'valid') if ($_GET["action"] == 'valid')
{ {
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('ValidateSending'),$langs->trans("ConfirmValidateSending",$expedition->ref),'confirm_valid'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('ValidateSending'),$langs->trans("ConfirmValidateSending",$expedition->ref),'confirm_valid');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de l'annulation * Confirmation de l'annulation
@ -573,8 +573,8 @@ else
*/ */
if ($_GET["action"] == 'annuler') if ($_GET["action"] == 'annuler')
{ {
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$expedition->ref),'confirm_cancel'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$expedition->ref),'confirm_cancel');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Calcul du poids total et du volume total des produits // Calcul du poids total et du volume total des produits

View File

@ -522,29 +522,29 @@ elseif ($_GET["id"] > 0)
// Confirmation de la suppression de la fiche d'intervention // Confirmation de la suppression de la fiche d'intervention
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation de la fiche d'intervention // Confirmation de la validation de la fiche d'intervention
if ($_GET['action'] == 'validate') if ($_GET['action'] == 'validate')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation de la fiche d'intervention // Confirmation de la validation de la fiche d'intervention
if ($_GET['action'] == 'modify') if ($_GET['action'] == 'modify')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la suppression d'une ligne d'intervention // Confirmation de la suppression d'une ligne d'intervention
if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -675,19 +675,10 @@ elseif ($_GET["id"] > 0)
print '</td>'; print '</td>';
print '<td align="center">'; print '<td align="center">';
if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&ligne='.$objp->rowid.'&action=confirm_deleteline&confirm=yes';
print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteInterventionLine').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'deleteline'.$i.'\')">';
print img_delete();
}
else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=ask_deleteline&amp;ligne='.$objp->rowid.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=ask_deleteline&amp;ligne='.$objp->rowid.'">';
print img_delete(); print img_delete();
} }
}
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=deleteline&amp;ligne='.$objp->rowid.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=deleteline&amp;ligne='.$objp->rowid.'">';
@ -849,48 +840,21 @@ elseif ($_GET["id"] > 0)
// Validate // Validate
if ($fichinter->statut == 0 && $user->rights->ficheinter->creer) if ($fichinter->statut == 0 && $user->rights->ficheinter->creer)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="fiche.php?id='.$_GET["id"].'&action=validate"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_validate&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateIntervention')).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
}
else
{
print 'href="fiche.php?id='.$_GET["id"].'&action=validate"';
}
print '>'.$langs->trans("Valid").'</a>'; print '>'.$langs->trans("Valid").'</a>';
} }
// Modify // Modify
if ($fichinter->statut == 1 && $user->rights->ficheinter->creer) if ($fichinter->statut == 1 && $user->rights->ficheinter->creer)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="fiche.php?id='.$_GET["id"].'&action=modify"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_modify&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmModifyIntervention')).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
}
else
{
print 'href="fiche.php?id='.$_GET["id"].'&action=modify"';
}
print '>'.$langs->trans("Modify").'</a>'; print '>'.$langs->trans("Modify").'</a>';
} }
// Delete // Delete
if (($fichinter->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer) if (($fichinter->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=delete"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_delete&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans("ConfirmDeleteIntervention",$fichinter->ref)).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>'; print '>'.$langs->trans('Delete').'</a>';
} }
} }

View File

@ -501,8 +501,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -525,8 +525,8 @@ if ($id > 0 || ! empty($ref))
$text.=$notify->confirmMessage(3,$commande->socid); $text.=$notify->confirmMessage(3,$commande->socid);
} }
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de l'approbation * Confirmation de l'approbation
@ -534,8 +534,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'approve') if ($_GET['action'] == 'approve')
{ {
$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder"),"confirm_approve"); $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder"),"confirm_approve");
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de la desapprobation * Confirmation de la desapprobation
@ -543,16 +543,16 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'refuse') if ($_GET['action'] == 'refuse')
{ {
$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder"),"confirm_refuse"); $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder"),"confirm_refuse");
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de l'annulation * Confirmation de l'annulation
*/ */
if ($_GET['action'] == 'cancel') if ($_GET['action'] == 'cancel')
{ {
$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder"),"confirm_cancel"); $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder"),"confirm_cancel");
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -561,9 +561,9 @@ if ($id > 0 || ! empty($ref))
if ($_GET["action"] == 'commande') if ($_GET["action"] == 'commande')
{ {
$date_com = dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); $date_com = dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
$html->form_confirm("fiche.php?id=".$commande->id."&amp;datecommande=".$date_com."&amp;methode=".$_POST["methodecommande"]."&amp;comment=".urlencode($_POST["comment"]), $ret=$html->form_confirm("fiche.php?id=".$commande->id."&amp;datecommande=".$date_com."&amp;methode=".$_POST["methodecommande"]."&amp;comment=".urlencode($_POST["comment"]),
$langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande"); $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande");
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -571,8 +571,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'delete_product_line' && ! empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE)) if ($_GET['action'] == 'delete_product_line' && ! empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE))
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -939,19 +939,7 @@ if ($id > 0 || ! empty($ref))
{ {
if ($user->rights->fournisseur->commande->valider) if ($user->rights->fournisseur->commande->valider)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=valid"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
// We check if number is temporary number
if (eregi('^\(PROV',$commande->ref)) $num = $commande->getNextNumRef($soc);
else $num = $commande->ref;
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=confirm_valid&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateOrder',$num)).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=valid"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
} }

View File

@ -577,8 +577,8 @@ else
// Confirmation de la suppression d'une ligne produit // Confirmation de la suppression d'une ligne produit
if ($_GET['action'] == 'confirm_delete_line') if ($_GET['action'] == 'confirm_delete_line')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation
@ -590,22 +590,22 @@ else
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation // Confirmation de la validation
if ($_GET['action'] == 'valid') if ($_GET['action'] == 'valid')
{ {
$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $fac->ref), 'confirm_valid'); $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $fac->ref), 'confirm_valid');
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation // Confirmation de la validation
if ($_GET['action'] == 'payed') if ($_GET['action'] == 'payed')
{ {
$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ClassifyPayed'), $langs->trans('ConfirmClassifyPayedBill', $fac->ref), 'confirm_payed'); $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ClassifyPayed'), $langs->trans('ConfirmClassifyPayedBill', $fac->ref), 'confirm_payed');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -613,8 +613,8 @@ else
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete'); $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
print '<table width="100%" class="notopnoleftnoright">'; print '<table width="100%" class="notopnoleftnoright">';
@ -1059,17 +1059,7 @@ else
if ($_GET['action'] != 'edit' && $fac->statut == 1 && $fac->paye == 0 && $user->societe_id == 0) if ($_GET['action'] != 'edit' && $fac->statut == 1 && $fac->paye == 0 && $user->societe_id == 0)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=payed"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$num = $fac->ref;
$url = $_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=confirm_payed&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmClassifPayed',$num)).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=payed"';
}
print '>'.$langs->trans('ClassifyPayed').'</a>'; print '>'.$langs->trans('ClassifyPayed').'</a>';
//print '<a class="butAction" href="fiche.php?facid='.$fac->id.'&amp;action=payed">'.$langs->trans('ClassifyPayed').'</a>'; //print '<a class="butAction" href="fiche.php?facid='.$fac->id.'&amp;action=payed">'.$langs->trans('ClassifyPayed').'</a>';
@ -1079,19 +1069,7 @@ else
{ {
if (sizeof($fac->lignes)) if (sizeof($fac->lignes))
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=valid"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
// We check if number is temporary number
if (eregi('^\(PROV',$fac->ref)) $num = $fac->getNextNumRef($soc);
else $num = $fac->ref;
$url = $_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=confirm_valid&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateBill',$num)).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=valid"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
} }

View File

@ -114,8 +114,8 @@ dol_fiche_head($head, $hselected, $langs->trans('SupplierPayment'));
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); $ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -123,8 +123,8 @@ if ($_GET['action'] == 'delete')
*/ */
if ($_GET['action'] == 'valide') if ($_GET['action'] == 'valide')
{ {
$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); $ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
print '<br>'; if ($ret == 'html') print '<br>';
} }
if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POST['new_num'])) if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POST['new_num']))

View File

@ -1534,19 +1534,32 @@ class Form
/** /**
* \brief Affiche formulaire de demande de confirmation * \brief Show a confirmation HTML form or AJAX popup
* \param page page * \param page page Url of page to call if confirmation is OK
* \param title title * \param title title
* \param question question * \param question question
* \param action action * \param action action
* \param formquestion an array with forms complementary inputs * \param formquestion an array with forms complementary inputs
* \param selectedchoice "" or "no" or "yes" * \param selectedchoice "" or "no" or "yes"
* \param allowajax 0=No, 1=Yes (Yes works only if option activated)
* \param string 'ajax' if a confirm ajax popup is shown, 'html' if it's an html form
*/ */
function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="") function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $allowajax=0)
{ {
global $langs; global $langs,$conf;
print "\n<!-- begin form_confirm -->\n"; print "\n<!-- begin form_confirm -->\n";
if ($allowajax && $conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$pageyes=$page.'&action='.$action.'&confirm=yes';
$pageno=$page.'&confirm=no';
print '<script type="text/javascript">dialogConfirm(\''.$pageyes.'\',\''.$pageno.'\',\''.dol_escape_js($question).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')</script>';
print "\n";
$ret='ajax';
}
else
{
print '<form method="post" action="'.$page.'" class="notoptoleftroright">'; print '<form method="post" action="'.$page.'" class="notoptoleftroright">';
print '<input type="hidden" name="action" value="'.$action.'">'; print '<input type="hidden" name="action" value="'.$action.'">';
@ -1630,8 +1643,11 @@ class Form
} }
print "</form>\n"; print "</form>\n";
$ret='html';
}
print "\n<!-- end form_confirm -->\n"; print "<!-- end form_confirm -->\n";
return $ret;
} }

View File

@ -677,7 +677,7 @@ function cleanSerialize(expr) {
Author: Regis Houssin Author: Regis Houssin
Licence: GPL Licence: GPL
==================================================================*/ ==================================================================*/
function dialogConfirm(linkurl,message,ok,cancel,objectID) { function dialogConfirm(linkurlyes,linkurlno,message,ok,cancel,objectID) {
Dialog.confirm(message, { Dialog.confirm(message, {
width:560, width:560,
okLabel: ok, okLabel: ok,
@ -685,8 +685,8 @@ function dialogConfirm(linkurl,message,ok,cancel,objectID) {
buttonClass: "buttonajax", buttonClass: "buttonajax",
id: objectID, id: objectID,
destroyOnClose: true, destroyOnClose: true,
cancel:function(win){}, ok:function(win) {window.location.href=linkurlyes; return true;},
ok:function(win) {window.location.href=linkurl; return true;} cancel:function(win) { if (linkurlno!='') { window.location.href=linkurlno; return true; } }
}); });
} }

View File

@ -395,8 +395,8 @@ else
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$expedition_id = $_GET["expid"]; $expedition_id = $_GET["expid"];
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id.'&amp;expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm"),'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id.'&amp;expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm"),'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -405,8 +405,8 @@ else
*/ */
if ($_GET["action"] == 'valid') if ($_GET["action"] == 'valid')
{ {
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm"),'confirm_valid'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm"),'confirm_valid');
print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -806,9 +806,8 @@ if ($_GET["id"] || $_GET["ref"])
// Confirmation de la suppression de la facture // Confirmation de la suppression de la facture
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html = new Form($db); $ret=$html->form_confirm("fiche.php?id=".$product->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete");
$html->form_confirm("fiche.php?id=".$product->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete"); if ($ret == 'html') print '<br>';
print "<br />\n";
} }
print($mesg); print($mesg);

View File

@ -110,8 +110,8 @@ if ($_GET["id"] || $_GET["ref"])
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$product->id.'&amp;file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$product->id.'&amp;file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
print($mesg); print($mesg);
@ -242,16 +242,8 @@ if ($_GET["id"] || $_GET["ref"])
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=addthumb&amp;file='.urlencode($pdir.$viewfilename).'">'.img_refresh($langs->trans('GenerateThumb')).'&nbsp;&nbsp;</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=addthumb&amp;file='.urlencode($pdir.$viewfilename).'">'.img_refresh($langs->trans('GenerateThumb')).'&nbsp;&nbsp;</a>';
} }
if ($user->rights->produit->creer) if ($user->rights->produit->creer)
{
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$product->id.'&file='.urlencode($pdir.$viewfilename).'&action=confirm_delete&confirm=yes';
print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeletePicture').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')">';
}
else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=delete&amp;file='.urlencode($pdir.$viewfilename).'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=delete&amp;file='.urlencode($pdir.$viewfilename).'">';
}
print img_delete().'</a>'; print img_delete().'</a>';
} }
if ($nbbyrow) print '</td>'; if ($nbbyrow) print '</td>';

View File

@ -200,8 +200,8 @@ else
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteAProject"),$langs->trans("ConfirmDeleteAProject"),"confirm_delete"); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteAProject"),$langs->trans("ConfirmDeleteAProject"),"confirm_delete");
print "<br>"; if ($ret == 'html') print '<br>';
} }
if ($_GET["action"] == 'edit') if ($_GET["action"] == 'edit')

View File

@ -92,8 +92,8 @@ if ($_GET["id"] > 0)
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete"); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
print "<br>"; if ($ret == 'html') print '<br>';
} }
print '<form method="POST" action="fiche.php?id='.$projet->id.'">'; print '<form method="POST" action="fiche.php?id='.$projet->id.'">';

View File

@ -959,8 +959,8 @@ else
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html = new Form($db); $html = new Form($db);
$html->form_confirm("soc.php?socid=".$soc->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete"); $ret=$html->form_confirm("soc.php?socid=".$soc->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,1);
print "<br />\n"; if ($ret == 'html') print '<br>';
} }
if ($mesg) if ($mesg)
@ -1244,17 +1244,7 @@ else
if ($user->rights->societe->supprimer) if ($user->rights->societe->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action=confirm_delete&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteCompany').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>';
} }
print '</div>'; print '</div>';

View File

@ -23,7 +23,7 @@
* \brief Tab for documents linked to third party * \brief Tab for documents linked to third party
* \ingroup societe * \ingroup societe
* \version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
@ -107,8 +107,8 @@ if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
/* /*
* View * View
*/ */
llxHeader(); llxHeader();
@ -161,8 +161,8 @@ if ($socid > 0)
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$_GET["id"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$_GET["id"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -764,8 +764,8 @@ else
*/ */
if ($action == 'password') if ($action == 'password')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$fuser->login),"confirm_password"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$fuser->login),"confirm_password");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -773,8 +773,8 @@ else
*/ */
if ($action == 'passwordsend') if ($action == 'passwordsend')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$fuser->login),"confirm_passwordsend"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$fuser->login),"confirm_passwordsend");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -782,8 +782,8 @@ else
*/ */
if ($action == 'disable') if ($action == 'disable')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$fuser->login),"confirm_disable"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$fuser->login),"confirm_disable");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -791,8 +791,8 @@ else
*/ */
if ($action == 'enable') if ($action == 'enable')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$fuser->login),"confirm_enable"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$fuser->login),"confirm_enable");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -800,8 +800,8 @@ else
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$fuser->login),"confirm_delete"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$fuser->login),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -221,17 +221,15 @@ else
$title = $langs->trans("Group"); $title = $langs->trans("Group");
dol_fiche_head($head, 'group', $title); dol_fiche_head($head, 'group', $title);
/* /*
* Confirmation suppression * Confirmation suppression
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$html = new Form($db); $ret=$html->form_confirm("fiche.php?id=$group->id",$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$group->name),"confirm_delete");
$html->form_confirm("fiche.php?id=$group->id",$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$group->name),"confirm_delete"); if ($ret == 'html') print '<br>';
} }
/* /*
* Fiche en mode visu * Fiche en mode visu
*/ */