diff --git a/htdocs/soc.php b/htdocs/soc.php
index 4a29340414d..bf1c2ebfc26 100644
--- a/htdocs/soc.php
+++ b/htdocs/soc.php
@@ -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->fetch($socid);
@@ -856,44 +856,44 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
print '';
print "\n";
}
- print '
'.$langs->trans('VATIntra').' | ';
- print '';
- $s ='';
- $s.='';
+ print ' | '.$langs->trans('VATIntra').' | ';
+ print '';
+ $s ='';
+ $s.='';
$s.=' ';
if ($conf->use_javascript)
{
- $s.=''.$langs->trans("VATIntraCheck").'';
- print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
+ $s.=''.$langs->trans("VATIntraCheck").'';
+ print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
}
else
{
print $s.'id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'';
}
- print ' | ';
- print '';
+ print '';
+ print '';
- print '| '.$langs->trans("Capital").' | '.$langs->trans("Currency".$conf->monnaie).' |
';
+ print '| '.$langs->trans("Capital").' | '.$langs->trans("Currency".$conf->monnaie).' |
';
- print '| '.$langs->trans('JuridicalStatus').' | ';
- $form->select_forme_juridique($soc->forme_juridique_code,$soc->pays_code);
- print ' |
';
+ print '| '.$langs->trans('JuridicalStatus').' | ';
+ $form->select_forme_juridique($soc->forme_juridique_code,$soc->pays_code);
+ print ' |
';
- print '| '.$langs->trans("Type").' | ';
- $form->select_array("typent_id",$soc->typent_array(0), $soc->typent_id);
- print ' | ';
- print ''.$langs->trans("Staff").' | ';
- $form->select_array("effectif_id",$soc->effectif_array(0), $soc->effectif_id);
- print ' |
';
+ print '| '.$langs->trans("Type").' | ';
+ $form->select_array("typent_id",$soc->typent_array(0), $soc->typent_id);
+ print ' | ';
+ print ''.$langs->trans("Staff").' | ';
+ $form->select_array("effectif_id",$soc->effectif_array(0), $soc->effectif_id);
+ print ' |
';
- print '| ';
- print '';
+ print ' |
| ';
+ print '';
print ' ';
- print '';
- print ' |
';
+ print '';
+ print '';
- print '';
- print '';
+ print '';
+ print '';
}
}
else
@@ -1174,7 +1174,7 @@ else
if ($user->rights->societe->creer)
{
- print ''.$langs->trans("Edit").'';
+ print 'id.'&action=edit">'.$langs->trans("Edit").'';
}
if ($conf->projet->enabled && $user->rights->projet->creer)
@@ -1190,7 +1190,17 @@ else
if ($user->rights->societe->supprimer)
{
- print ''.$langs->trans("Delete").'';
+ print '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').'';
}
print '';