Mise au look onglet de l'onglet Fiche compta.

This commit is contained in:
Laurent Destailleur 2004-05-29 15:36:04 +00:00
parent 485719d48f
commit 5b6aad6901

View File

@ -111,7 +111,6 @@ if ($action == 'stcomm')
/* /*
* Recherche * Recherche
* *
*
*/ */
if ($mode == 'search') if ($mode == 'search')
{ {
@ -144,61 +143,72 @@ if ($mode == 'search')
* *
* Mode fiche * Mode fiche
* *
*
*/ */
if ($socid > 0) if ($socid > 0)
{ {
$societe = new Societe($db, $socid); $objsoc = new Societe($db);
$objsoc->id = $socid;
$objsoc->idp = $socid;
$objsoc->fetch($socid, $to); // si $to='next' ajouter " AND s.idp > $socid ORDER BY idp ASC LIMIT 1";
$sql = "SELECT s.idp as idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."c_typent as t, ".MAIN_DB_PREFIX."c_effectif as e ";
$sql .= " WHERE s.fk_stcomm=st.id AND s.fk_typent = t.id AND s.fk_effectif = e.id";
if ($to == 'next') /*
* Affichage onglets
*/
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$socid;
$head[$h][1] = "Fiche société";
$h++;
if ($objsoc->client==1)
{ {
$sql .= " AND s.idp > $socid ORDER BY idp ASC LIMIT 1"; $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$socid;
$head[$h][1] = 'Fiche client';
$h++;
} }
elseif ($to == 'prev') { if ($objsoc->client==2)
$sql .= " AND s.idp < $socid ORDER BY idp DESC LIMIT 1"; {
} else { $head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$socid;
$sql .= " AND s.idp = $socid"; $head[$h][1] = 'Fiche prospect';
$h++;
}
if ($objsoc->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$socid;
$head[$h][1] = 'Fiche fournisseur';
$h++;
} }
$result = $db->query($sql); if ($conf->compta->enabled) {
$hselected=$h;
if ($result) { $head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$socid;
$objsoc = $db->fetch_object(0); $head[$h][1] = 'Fiche compta';
$h++;
if (! $objsoc->idp) {
print("Cette societe n'existe pas ou plus");
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
exit;
} }
$dac = strftime("%Y-%m-%d %H:%M", time()); $head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$socid;
if ($errmesg) { $head[$h][1] = 'Note';
print "<b>$errmesg</b><br>"; $h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$socid;
$head[$h][1] = 'Documents';
$h++;
} }
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$socid;
$head[$h][1] = 'Notifications';
dolibarr_fiche_head($head, $hselected);
/* /*
* *
*/ */
print "<table width=\"100%\" border=\"0\" cellspacing=\"1\">\n"; print "<table width=\"100%\" border=\"0\" cellspacing=\"1\">\n";
print "<tr><td><div class=\"titre\">Fiche client : $objsoc->nom</div></td>";
if ($user->societe_id == 0)
{
print '<td align="center"><a href="../comm/fiche.php?socid='.$objsoc->idp.'">Commercial</a></td>';
print "<td align=\"center\">[<a href=\"../comm/docsoc.php?socid=$objsoc->idp\">Documents</a>]</td>";
print "<td align=\"center\">[<a href=\"index.php?socidp=$objsoc->idp&action=add\">Bookmark</a>]</td>";
if ($user->rights->facture->creer)
print "<td>[<a href=\"facture.php?action=create&socidp=$objsoc->idp\">".translate("Facturer")."</a>]</td>";
print "<td>[<a href=\"../socnote.php?socid=$objsoc->idp\">Notes</a>]</td>";
print "<td align=\"center\">[<a href=\"deplacement/fiche.php?socid=$objsoc->idp&action=create\">Déplacement</a>]</td>";
}
print "</tr></table>";
/* /*
* *
* *
@ -207,10 +217,11 @@ if ($socid > 0)
print '<table width="100%" border="0"><tr>'; print '<table width="100%" border="0"><tr>';
print '<tr><td valign="top">'; print '<tr><td valign="top">';
print '<table class="border" cellspacing="0" width="100%">'; print '<table class="border" cellspacing="0" width="100%">';
print '<tr><td width="20%">Nom</td><td width="80%" colspan="3">'.$objsoc->nom.'</td></tr>';
print '<tr><td>Tel</td><td>'.$objsoc->tel.'&nbsp;</td><td>Fax</td><td>'.$objsoc->fax.'&nbsp;</td></tr>'; print '<tr><td>Tel</td><td>'.$objsoc->tel.'&nbsp;</td><td>Fax</td><td>'.$objsoc->fax.'&nbsp;</td></tr>';
print '<tr><td>Ville</td><td colspan="3">'.nl2br($objsoc->address)."<br>$objsoc->cp $objsoc->ville</td></tr>"; print '<tr><td>Ville</td><td colspan="3">'.nl2br($objsoc->adresse)."<br>$objsoc->cp $objsoc->ville</td></tr>";
print '<tr><td>siren</td><td><a href="http://www.societe.com/cgi-bin/recherche?rncs='.$objsoc->siren.'">'.$objsoc->siren.'</a>&nbsp;</td>'; print '<tr><td>Siren</td><td><a href="http://www.societe.com/cgi-bin/recherche?rncs='.$objsoc->siren.'">'.$objsoc->siren.'</a>&nbsp;</td>';
print "<td>prefix</td><td>"; print "<td>prefix</td><td>";
if ($objsoc->prefix_comm) if ($objsoc->prefix_comm)
{ {
@ -227,6 +238,12 @@ if ($socid > 0)
print "</table>"; print "</table>";
if ($user->societe_id == 0)
{
print "[<a href=\"index.php?socidp=$objsoc->id&action=add_bookmark\">Bookmark fiche</a>]<br>";
}
print "<br>";
/* /*
* *
*/ */
@ -318,15 +335,35 @@ if ($socid > 0)
* *
*/ */
print "</td></tr>"; print "</td></tr>";
print "</table>\n"; print "</table></div>\n";
/* /*
* Barre d'actions
* *
*/
print '<div class="tabsAction">';
if ($user->societe_id == 0)
{
if ($user->rights->facture->creer)
print "<a class=\"tabAction\" href=\"facture.php?action=create&socidp=$objsoc->idp\">".translate("Facturer")."</a>";
print "<a class=\"tabAction\" href=\"deplacement/fiche.php?socid=$objsoc->idp&action=create\">Créer Déplacement</a>";
}
print '<a class="tabAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid.'&amp;action=create">Ajouter un contact</a>';
print '<a class="tabAction" href="'.DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$socid.'">Notifications</a>';
print '</div>';
print '<br>';
/*
* *
* *
*/ */
if ($action == 'changevalue') { if ($action == 'changevalue') {
print "<HR noshade>"; print "<hr noshade>";
print "<form action=\"index.php?socid=$objsoc->idp\" method=\"post\">"; print "<form action=\"index.php?socid=$objsoc->idp\" method=\"post\">";
print "<input type=\"hidden\" name=\"action\" value=\"cabrecrut\">"; print "<input type=\"hidden\" name=\"action\" value=\"cabrecrut\">";
print "Cette société est un cabinet de recrutement : "; print "Cette société est un cabinet de recrutement : ";
@ -337,23 +374,24 @@ if ($socid > 0)
print "</select>"; print "</select>";
print "<input type=\"submit\" value=\"Mettre &agrave; jour\">"; print "<input type=\"submit\" value=\"Mettre &agrave; jour\">";
print "</form>\n"; print "</form>\n";
} else { } else {
/* /*
* *
* Liste des contacts * Liste des contacts
* *
*/ */
print '<table width="100%" cellspacing="0" border="0" cellpadding="2">'; print '<table width="100%" cellspacing="1" border="0" cellpadding="2">';
print '<tr class="liste_titre"><td><b>Pr&eacute;nom Nom</b></td>'; print '<tr class="liste_titre"><td><b>Pr&eacute;nom Nom</b></td>';
print '<td><b>Poste</b></td><td><b>T&eacute;l</b></td>'; print '<td><b>Poste</b></td><td><b>T&eacute;l</b></td>';
print "<td><b>Fax</b></td><td><b>Email</b></td>"; print "<td><b>Fax</b></td><td><b>Email</b></td>";
print "<td><a href=\"../comm/people.php?socid=$objsoc->idp&action=addcontact\">Ajouter</a></td></tr>"; print "<td align=\"center\"><a href=\"".DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid."&amp;action=create\">Ajouter</a></td></tr>";
$sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec"; $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec";
$result = $db->query($sql); $result = $db->query($sql);
$i = 0 ; $num = $db->num_rows(); $i = 0 ; $num = $db->num_rows();
$var=1;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object( $i); $obj = $db->fetch_object( $i);
@ -375,7 +413,7 @@ if ($socid > 0)
print '<td><a href="../comm/action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->phone.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->phone.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->fax.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->fax.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->email.'</a>&nbsp;</td>';
print "<td><a href=\"../comm/people.php?socid=$objsoc->idp&action=editcontact&contactid=$obj->idp\">Modifier</a></td>"; print "<td align=\"center\"><a href=\"../comm/people.php?socid=$objsoc->idp&action=editcontact&contactid=$obj->idp\">".img_edit()."</a></td>";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
$tag = !$tag; $tag = !$tag;
@ -464,9 +502,11 @@ if ($socid > 0)
* Notes sur la societe * Notes sur la societe
* *
*/ */
if ($objsoc->note) {
print '<table border="1" width="100%" cellspacing="0" bgcolor="#e0e0e0">'; print '<table border="1" width="100%" cellspacing="0" bgcolor="#e0e0e0">';
print "<tr><td>".nl2br($objsoc->note)."</td></tr>"; print "<tr><td>".nl2br($objsoc->note)."</td></tr>";
print "</table>"; print "</table>";
}
/* /*
* *
* *
@ -474,9 +514,7 @@ if ($socid > 0)
*/ */
} }
} else {
print $db->error() . "<br>" . $sql;
}
} else { } else {
print "Erreur"; print "Erreur";
} }