Ajout popup ajax de confirmation
This commit is contained in:
parent
55c7787348
commit
3e6b55fdb3
@ -194,7 +194,7 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"])
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes' && $user->rights->societe->supprimer)
|
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->societe->supprimer)
|
||||||
{
|
{
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($socid);
|
$soc->fetch($socid);
|
||||||
@ -1174,7 +1174,7 @@ else
|
|||||||
|
|
||||||
if ($user->rights->societe->creer)
|
if ($user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/soc.php?socid='.$soc->id.'&action=edit">'.$langs->trans("Edit").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action=edit">'.$langs->trans("Edit").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->projet->enabled && $user->rights->projet->creer)
|
if ($conf->projet->enabled && $user->rights->projet->creer)
|
||||||
@ -1190,7 +1190,17 @@ else
|
|||||||
|
|
||||||
if ($user->rights->societe->supprimer)
|
if ($user->rights->societe->supprimer)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.DOL_URL_ROOT.'/soc.php?socid='.$soc->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" ';
|
||||||
|
if ($conf->use_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.'&action=delete"';
|
||||||
|
}
|
||||||
|
print '>'.$langs->trans('Delete').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user