delete supp societe

This commit is contained in:
hitweb 2003-09-12 14:08:02 +00:00
parent 0e6b7a428b
commit cedc9a8381
3 changed files with 19 additions and 52 deletions

View File

@ -1,7 +1,3 @@
2003-09-12 Brian Fraval <brian@fraval.org>
* Ajout de la suppression d'une société, avec confirmation.
2003-09-12 Rodolphe Quiédeville <rq@quiedeville.org> 2003-09-12 Rodolphe Quiédeville <rq@quiedeville.org>
* Correction DOL_URL_ROOT dans fourn/contact.php sur l'image * Correction DOL_URL_ROOT dans fourn/contact.php sur l'image

View File

@ -36,15 +36,6 @@ if ($user->societe_id > 0)
llxHeader(); llxHeader();
if ($action == 'del')
{
print_titre("Suppression de la société");
$soc = new Societe($db);
$soc->delete($socid);
}
if ($action == 'add') if ($action == 'add')
{ {
$soc = new Societe($db); $soc = new Societe($db);
@ -165,40 +156,22 @@ elseif ($action == 'edit')
print '</form>'; print '</form>';
} }
} else { } else {
if ($action != "del") print_titre("Fiche société");
{
print_titre("Fiche société"); $soc = new Societe($db);
$soc->id = $socid;
$soc = new Societe($db); $soc->fetch($socid);
$soc->id = $socid;
$soc->fetch($socid); print '<table border="1" cellpadding="3" cellspacing="0" width="100%">';
print '<tr><td width="20%">Nom</td><td class="valeur">'.$soc->nom.'</td></tr>';
print " print '<tr><td valign="top">Adresse</td><td class="valeur">'.nl2br($soc->adresse).'&nbsp;</td></tr>';
<SCRIPT language=\"JavaScript\"> print '<tr><td>CP</td><td class="valeur">'.$soc->cp.'&nbsp;'.$soc->ville.'</td></tr>';
<!--
function Delete(socid) print '<tr><td>Tel</td><td class="valeur">'.$soc->tel.'</td></tr>';
{ print '<tr><td>Fax</td><td class="valeur">'.$soc->fax.'</td></tr>';
var where_to= confirm(\"Voulez vous vraiment supprimer cette société ?\"); print '<tr><td>Web</td><td><a href="http://'.$soc->url.'">http://'.$soc->url.'</a></td></tr>';
if (where_to == true)
{
window.location.replace(\"$dolibarr_main_url_root/soc.php?socid=\"+socid+\"&action=del\");
}
}
//-->
</SCRIPT>
";
print '<table border="1" cellpadding="3" cellspacing="0" width="100%">';
print '<tr><td width="20%">Nom</td><td class="valeur">'.$soc->nom.'</td></tr>';
print '<tr><td valign="top">Adresse</td><td class="valeur">'.nl2br($soc->adresse).'&nbsp;</td></tr>';
print '<tr><td>CP</td><td class="valeur">'.$soc->cp.'&nbsp;'.$soc->ville.'</td></tr>';
print '<tr><td>Tel</td><td class="valeur">'.$soc->tel.'</td></tr>';
print '<tr><td>Fax</td><td class="valeur">'.$soc->fax.'</td></tr>';
print '<tr><td>Web</td><td><a href="http://'.$soc->url.'">http://'.$soc->url.'</a></td></tr>';
print '<tr><td>Siren</td><td>'.$soc->siren.'&nbsp;</td></tr>'; print '<tr><td>Siren</td><td>'.$soc->siren.'&nbsp;</td></tr>';
@ -232,7 +205,7 @@ function Delete(socid)
print '<td width="20%" align="center">[<a href="soc.php?socid='.$socid.'&action=edit">Editer</a>]</td>'; print '<td width="20%" align="center">[<a href="soc.php?socid='.$socid.'&action=edit">Editer</a>]</td>';
print '<td width="20%" align="center">[<a href="#" Onclick="javascript:Delete('.$socid.')">Supprimer</a>]</td>'; print '<td width="20%" align="center">-</td>';
print '<td width="20%" align="center">-</td>'; print '<td width="20%" align="center">-</td>';
print '<td width="20%" align="center">-</td>'; print '<td width="20%" align="center">-</td>';
print '<td width="20%" align="center">[<a href="societe/notify/fiche.php?socid='.$socid.'">Notifications</a>]</td>'; print '<td width="20%" align="center">[<a href="societe/notify/fiche.php?socid='.$socid.'">Notifications</a>]</td>';
@ -267,8 +240,6 @@ function Delete(socid)
} }
} }
} }
}
} }
$db->close(); $db->close();

View File

@ -96,7 +96,8 @@ class Societe {
/* /*
* Suppression d'une societe. * Suppression d'une societe.
* TODO: il faut ajouter la suppression du répertoire de la societe * TODO: Cette fonction n'est pas utilisée..
* Attente des contraintes d'intégrité dans MySql
*/ */
Function delete($id) Function delete($id)
{ {
@ -126,7 +127,6 @@ class Societe {
rmdir(${dir}); rmdir(${dir});
} }
if (file_exists ($docdir)) if (file_exists ($docdir))
{ {
deldir($docdir); deldir($docdir);