2
0
forked from Wavyzz/dolibarr

Meilleur gestion des fiches de cration d'action. Code mieux comment.

This commit is contained in:
Laurent Destailleur
2004-08-06 23:39:54 +00:00
parent f6c563b395
commit ff24f65564
4 changed files with 238 additions and 157 deletions

View File

@@ -21,6 +21,8 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
$langs->load("company");
require("../../contact.class.php"); require("../../contact.class.php");
require("../../lib/webcal.class.php"); require("../../lib/webcal.class.php");
require("../../cactioncomm.class.php"); require("../../cactioncomm.class.php");
@@ -47,58 +49,38 @@ if ($_POST["action"] == 'add_action')
$contact = new Contact($db); $contact = new Contact($db);
$contact->fetch($_POST["contactid"]); $contact->fetch($_POST["contactid"]);
} }
$societe = new Societe($db); if ($_POST["socid"])
$societe->fetch($_POST["socid"]);
if ($_POST["afaire"] <> 1)
{ {
$actioncomm = new ActionComm($db); $societe = new Societe($db);
$societe->fetch($_POST["socid"]);
$actioncomm->priority = 2;
$actioncomm->type = $_POST["actionid"];
$actioncomm->date = $db->idate(mktime($_POST["heurehour"],
$_POST["heuremin"],
0,
$_POST["acmonth"],
$_POST["acday"],
$_POST["acyear"])
);
if ($_POST["actionid"] == 5)
{
$actioncomm->percent = 0;
}
else
{
$actioncomm->percent = 100;
}
$actioncomm->contact = $_POST["contactid"];
$actioncomm->user = $user;
$actioncomm->societe = $_POST["socid"];
$actioncomm->note = $_POST["note"];
$actioncomm->add($user);
} }
if ($todo == 'on' ) if ($_POST["actionid"]) {
{
$todo = new ActionComm($db); $actioncomm = new ActionComm($db);
$todo->type = $_POST["nextactionid"];
$todo->date = $db->idate(mktime(12,0,0,$remonth, $reday, $reyear)); $actioncomm->type = $_POST["actionid"];
$todo->libelle = $todo_label; $actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0;
$todo->priority = 2; $actioncomm->libelle = $_POST["label"];
$todo->societe = $societe->id;
$todo->contact = $contactid; $actioncomm->date = $db->idate(mktime($_POST["heurehour"],
$todo->user = $user; $_POST["heuremin"],
$todo->note = $todo_note; 0,
$todo->percent = 0; $_POST["acmonth"],
$_POST["acday"],
$todo->add($user); $_POST["acyear"])
);
$actioncomm->percent = isset($_POST["percentage"])?$_POST["percentage"]:0;
$actioncomm->user = $user;
$actioncomm->societe = isset($_POST["socid"])?$_POST["socid"]:0;
$actioncomm->contact = isset($_POST["contactid"])?$_POST["contactid"]:0;
$actioncomm->note = $_POST["note"];
$actioncomm->add($user);
if ($conf->webcal && $todo_webcal == 'on') if ($conf->webcal && $todo_webcal == 'on')
{ {
$webcal = new Webcal(); $webcal = new Webcal();
@@ -106,166 +88,220 @@ if ($_POST["action"] == 'add_action')
$webcal->heure = $heurehour . $heuremin . '00'; $webcal->heure = $heurehour . $heuremin . '00';
$webcal->duree = ($dureehour * 60) + $dureemin; $webcal->duree = ($dureehour * 60) + $dureemin;
if ($actionid == 5) if ($_POST["actionid"] == 5)
{ {
$libelle = "Rendez-vous avec ".$contact->fullname; $libelle = "Rendez-vous avec ".$contact->fullname;
$libelle .= "\n" . $todo->libelle; $libelle .= "\n" . $actioncomm->libelle;
} }
else else
{ {
$libelle = $todo->libelle; $libelle = $actioncomm->libelle;
} }
$webcal->add($user, $todo->date, $societe->nom, $libelle); $webcal->add($user, $actioncomm->date, $societe->nom, $libelle);
} }
}
// Header("Location: ".DOL_URL_ROOT."/comm/fiche.php?socid=$socid"); // Header("Location: ".DOL_URL_ROOT."/comm/fiche.php?socid=$socid");
Header("Location: ".$_POST["from"]); Header("Location: ".$_POST["from"]);
} else {
print "Le type d'action n'a pas <20>t<EFBFBD> choisi";
}
} }
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
{ {
$actioncomm = new ActionComm($db); $actioncomm = new ActionComm($db);
$actioncomm->delete($id); $actioncomm->delete($id);
Header("Location: index.php"); Header("Location: index.php");
} }
if ($action=='update') if ($_POST["action"] == 'update')
{ {
$action = new Actioncomm($db); $action = new Actioncomm($db);
$action->fetch($id); $action->fetch($_POST["id"]);
$action->percent = $_POST["percent"]; $action->percent = $_POST["percent"];
$action->contact->id = $_POST["scontactid"]; $action->contact->id = $_POST["contactid"];
$action->update(); $action->update();
Header("Location: ".$_POST["from"]);
} }
/******************************************************************************/
/* */
/* Fin des Actions */
/* */
/******************************************************************************/
llxHeader(); llxHeader();
$html = new Form($db); $html = new Form($db);
/* /*
* * Affichage fiche action vierge en mode creation
*
* *
*/ */
if ($_GET["action"] == 'create') if ($_GET["action"] == 'create')
{ {
$caction = new CActioncomm($db); $caction = new CActioncomm($db);
if ($_GET["afaire"] <> 1) if ($_GET["contactid"])
{ {
$caction->fetch($db, $_GET["actionid"]);
$contact = new Contact($db); $contact = new Contact($db);
$contact->fetch($_GET["contactid"]); $contact->fetch($_GET["contactid"]);
} }
$societe = new Societe($db);
$societe->get_nom($_GET["socid"]); print '<form action="fiche.php" method="post">';
print '<form action="fiche.php?socid='.$_GET["socid"].'" method="post">';
print '<input type="hidden" name="from" value="'.$_SERVER["HTTP_REFERER"].'">'; print '<input type="hidden" name="from" value="'.$_SERVER["HTTP_REFERER"].'">';
print '<input type="hidden" name="action" value="add_action">'; print '<input type="hidden" name="action" value="add_action">';
print '<input type="hidden" name="actionid" value="'.$_GET["actionid"].'">'."\n";
print '<input type="hidden" name="contactid" value="'.$_GET["contactid"].'">';
print '<input type="hidden" name="socid" value="'.$_GET["socid"].'">';
/* /*
* Rendez-vous * Si action de type Rendez-vous
* *
*/ */
if ($_GET["actionid"] == 5) if ($_GET["actionid"] == 5)
{ {
print_titre ("Saisie d'une action Rendez-vous");
print "<br>";
print '<input type="hidden" name="date" value="'.$db->idate(time()).'">'."\n"; print '<input type="hidden" name="date" value="'.$db->idate(time()).'">'."\n";
print '<table class="border" width="100%" border="1" cellspacing="0" cellpadding="3">'; print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
// Type d'action
print '<tr><td colspan="2"><div class="titre">Rendez-vous</div></td></tr>'; print '<tr><td colspan="2"><div class="titre">Rendez-vous</div></td></tr>';
print '<tr><td width="10%">Soci<63>t<EFBFBD></td><td width="40%">'; print '<input type="hidden" name="actionid" value="5">';
print '<a href="../fiche.php?socid='.$socid.'">'.$societe->nom.'</a></td></tr>';
print '<tr><td width="10%">Contact</td><td width="40%">'.$contact->fullname.'</td></tr>'; // Societe, contact
print '<tr><td width="10%">Date</td><td width="40%">'; print '<tr><td width="10%">'.$langs->trans("Action concernant la companie").'</td><td width="40%">';
$html= new Form($db); if ($_GET["socid"]) {
$societe = new Societe($db);
$nomsoc=$societe->get_nom($_GET["socid"]);
print '<a href="../fiche.php?socid='.$_GET["socid"].'">'.$nomsoc.'</a>';
print '<input type="hidden" name="socid" value="'.$_GET["socid"].'">';
}
else {
print $html->select_societes('','socid',1,1);
}
print '</td></tr>';
// Si la societe est impos<6F>e, on propose ces contacts
if ($_GET["socid"]) {
print '<tr><td width="10%">'.$langs->trans("Action concernant le contact").'</td><td width="40%">';
print $html->select_contacts($_GET["socid"],'','contactid',1,1);
print '</td></tr>';
}
print '<tr><td width="10%">'.$langs->trans("Date").'</td><td width="40%">';
$html->select_date('','ac'); $html->select_date('','ac');
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="10%">Heure</td><td width="40%">'; print '<tr><td width="10%">'.$langs->trans("Hour").'</td><td width="40%">';
print_heure_select("heure",8,20); print_heure_select("heure",8,20);
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="10%">Dur<EFBFBD>e</td><td width="40%">'; print '<tr><td width="10%">'.$langs->trans("Duration").'</td><td width="40%">';
print_duree_select("duree"); print_duree_select("duree");
print '</td></tr>'; print '</td></tr>';
print '<tr><td valign="top">Commentaire</td><td>'; print '<tr><td valign="top">Commentaire</td><td>';
print '<textarea cols="60" rows="6" name="todo_note"></textarea></td></tr>'; print '<textarea cols="60" rows="6" name="todo_note"></textarea></td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"></td></tr>'; print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("Add").'"></td></tr>';
print '</form></table>'; print '</table>';
} }
/* /*
* * Si action de type autre que rendez-vous
* Action autre que rendez-vous
*
* *
*/ */
else else
{ {
if ($_GET["afaire"] <> 1) print_titre ("Saisie d'une action");
{ print "<br>";
print_titre ("Action effectu<74>e");
print '<table class="border" width="100%" border="1" cellspacing="0" cellpadding="3">'; print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
print '<tr><td width="10%">Action</td><td>'.$caction->libelle.'</td></tr>'; // Type d'action
print '<tr><td width="10%">Soci<EFBFBD>t<EFBFBD></td><td width="40%">'; print '<tr><td width="10%">'.$langs->trans("Action").'</td><td>';
print '<a href="../fiche.php?socid='.$_GET["socid"].'">'.$societe->nom.'</a></td></tr>'; if ($_GET["actionid"]) {
print '<tr><td width="10%">Contact</td><td width="40%">'.$contact->fullname.'</td></tr>'; print '<input type="hidden" name="actionid" value="'.$_GET["actionid"].'">'."\n";
print '<td>Date</td><td>'; print $caction->get_nom($_GET["actionid"]);
print $html->select_date('','ac',1,1); } else {
$html->select_array("actionid", $caction->liste_array(), 0);
}
print '</td></tr>';
print '<tr><td width="10%">'.$langs->trans("Label").'</td><td><input type="text" name="todo_label" size="30"></td></tr>';
// Societe, contact
print '<tr><td width="10%">'.$langs->trans("Action concernant la companie").'</td><td width="40%">';
if ($_GET["socid"]) {
$societe = new Societe($db);
$nomsoc=$societe->get_nom($_GET["socid"]);
print '<a href="../fiche.php?socid='.$_GET["socid"].'">'.$nomsoc.'</a>';
print '<input type="hidden" name="socid" value="'.$_GET["socid"].'">';
}
else {
print $html->select_societes('','socid',1,1);
}
print '</td></tr>'; print '</td></tr>';
print '<tr><td valign="top">Commentaire</td><td>';
print '<textarea cols="60" rows="6" name="note"></textarea></td></tr>'; // Si la societe est impos<6F>e, on propose ces contacts
print "</table><p />"; if ($_GET["socid"]) {
} print '<tr><td width="10%">'.$langs->trans("Action concernant le contact").'</td><td width="40%">';
print $html->select_contacts($_GET["socid"],'','contactid',1,1);
print '</td></tr>';
}
print_titre ("Prochaine Action <20> faire"); // Avancement
if ($_GET["afaire"] == 1)
print '<table class="border" width="100%" border="1" cellspacing="0" cellpadding="3">';
if ($_GET["afaire"] <> 1)
{
print '<tr><td width="10%">'.$langs->trans("Add").'</td><td><input type="checkbox" name="todo"></td></tr>';
}
else
{ {
print '<input type="hidden" name="percentage" value="0">';
print '<input type="hidden" name="todo" value="on">'; print '<input type="hidden" name="todo" value="on">';
print '<input type="hidden" name="afaire" value="1">'; print '<tr><td width="10%">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td>To do / 0%</td></tr>';
print '<tr><td width="10%">Soci<63>t<EFBFBD></td><td width="40%">'; }
print '<a href="../fiche.php?socid='.$_GET["socid"].'">'.$societe->nom.'</a></td></tr>'; elseif ($_GET["afaire"] == 2)
{
print '<input type="hidden" name="percentage" value="100">';
print '<tr><td width="10%">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td>Done / 100%</td></tr>';
} else
{
print '<tr><td width="10%">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td><input type="text" name="percentage" value="0%"></td></tr>';
} }
print '<tr><td width="10%">Date</td><td width="40%">'; // Date
print $html->select_date(); print '<tr><td width="10%">'.$langs->trans("Date").'</td><td width="40%">';
if ($_GET["afaire"] == 1)
{
print $html->select_date('','ac');
} else if ($_GET["afaire"] == 2) {
print $html->select_date('','ac',1,1);
} else {
print $html->select_date('','ac',1,1);
}
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="10%">Action</td><td>';
$html->select_array("nextactionid", $caction->liste_array(), 0); // Lien avec celendrier si module activ<69>
print '</td></tr>'; if ($conf->webcal->enabled)
print '<tr><td width="10%">Action</td><td><input type="text" name="todo_label" size="30"></td></tr>';
if (defined("MAIN_MODULE_WEBCALENDAR") && MAIN_MODULE_WEBCALENDAR)
{ {
print '<tr><td width="10%">Calendrier</td><td><input type="checkbox" name="todo_webcal"></td></tr>'; $langs->load("other");
print '<tr><td width="10%">'.$langs->trans("AddCalendarEntry").'</td><td><input type="checkbox" name="todo_webcal"></td></tr>';
} }
print '<tr><td valign="top">Commentaire</td><td>';
// Description
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
print '<textarea cols="60" rows="6" name="todo_note"></textarea></td></tr>'; print '<textarea cols="60" rows="6" name="todo_note"></textarea></td></tr>';
print '</table>'; print '</table>';
print '<p align="center"><input type="submit" value="Enregistrer"></p>'; print '<p align="center"><input type="submit" value="'.$langs->trans("Add").'"></p>';
print "</form>";
} }
print "</form>";
} }
/* /*
* *
* *
@@ -273,6 +309,7 @@ if ($_GET["action"] == 'create')
*/ */
if ($_GET["id"]) if ($_GET["id"])
{ {
// Confirmation suppression action
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
print '<form method="post" action="fiche.php?id='.$_GET["id"].'">'; print '<form method="post" action="fiche.php?id='.$_GET["id"].'">';
@@ -299,19 +336,22 @@ if ($_GET["id"])
$act->author->fetch($act->author->id); $act->author->fetch($act->author->id);
$act->contact->fetch($act->contact->id); $act->contact->fetch($act->contact->id);
// Fiche action en mode edition
if ($_GET["action"] == 'edit') if ($_GET["action"] == 'edit')
{ {
print_titre ("Edition de la fiche action"); print_titre ("Edition de la fiche action");
print '<form action="fiche.php?id='.$_GET["id"].'" method="post">'; print '<form action="fiche.php" method="post">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<table class="border" width="100%" border="1" cellspacing="0" cellpadding="3">'; print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
print '<input type="hidden" name="from" value="'.$_SERVER["HTTP_REFERER"].'">';
print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
print '<tr><td width="20%">Type</td><td colspan="3">'.$act->type.'</td></tr>'; print '<tr><td width="20%">Type</td><td colspan="3">'.$act->type.'</td></tr>';
print '<tr><td width="20%">Soci<63>t<EFBFBD></td>'; print '<tr><td width="20%">Soci<63>t<EFBFBD></td>';
print '<td width="30%"><a href="../fiche.php?socid='.$act->societe->id.'">'.$act->societe->nom.'</a></td>'; print '<td width="30%"><a href="../fiche.php?socid='.$act->societe->id.'">'.$act->societe->nom.'</a></td>';
print '<td width="20%">Contact</td><td width="30%">'; print '<td width="20%">Contact</td><td width="30%">';
$html->select_array("scontactid", $act->societe->contact_array(), $act->contact->id, 1); $html->select_array("contactid", $act->societe->contact_array(), $act->contact->id, 1);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("Author").'</td><td>'.strftime('%d %B %Y %H:%M',$act->date).'</td>'; print '<tr><td>'.$langs->trans("Author").'</td><td>'.strftime('%d %B %Y %H:%M',$act->date).'</td>';
print '<td>'.$langs->trans("Author").'</td><td>'.$act->author->fullname.'</td></tr>'; print '<td>'.$langs->trans("Author").'</td><td>'.$act->author->fullname.'</td></tr>';
@@ -332,6 +372,7 @@ if ($_GET["id"])
} }
else else
{ {
// Affichage fiche action en mode visu
print_titre ("Action commerciale"); print_titre ("Action commerciale");
print '<table class="border" width="100%" border="1" cellspacing="0" cellpadding="3">'; print '<table class="border" width="100%" border="1" cellspacing="0" cellpadding="3">';

View File

@@ -32,8 +32,16 @@ $user->getrights('commande');
$user->getrights('projet'); $user->getrights('projet');
$langs->load("orders");
$langs->load("companies");
llxHeader(); llxHeader();
$sortorder=$_GET["sortorder"];
$sortfield=$_GET["sortfield"];
if ($sortorder == "") { if ($sortorder == "") {
$sortorder="ASC"; $sortorder="ASC";
} }
@@ -198,14 +206,14 @@ if ($_socid > 0)
*/ */
print '<table width="100%" border="0">'; print '<table width="100%" border="0">';
print '<tr><td valign="top">'; print '<tr><td valign="top">';
print '<table class="border" cellpadding="3" cellspacing="0" border="1" width="100%">'; print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
print '<tr><td width="20%">Nom</td><td width="80%" colspan="3">'; print '<tr><td width="20%">'.$langs->trans("FirstName").'</td><td width="80%" colspan="3">';
print $objsoc->nom; print $objsoc->nom;
print '</td></tr>'; print '</td></tr>';
print "<tr><td valign=\"top\">Adresse</td><td colspan=\"3\">".nl2br($objsoc->adresse)."<br>".$objsoc->cp." ".$objsoc->ville." ".$objsoc->pays."</td></tr>"; print "<tr><td valign=\"top\">".$langs->trans("Address")."</td><td colspan=\"3\">".nl2br($objsoc->adresse)."<br>".$objsoc->cp." ".$objsoc->ville." ".$objsoc->pays."</td></tr>";
print '<tr><td>T<EFBFBD>l<EFBFBD>phone</td><td>'.dolibarr_print_phone($objsoc->tel).'&nbsp;</td><td>Fax</td><td>'.dolibarr_print_phone($objsoc->fax).'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dolibarr_print_phone($objsoc->tel).'&nbsp;</td><td>Fax</td><td>'.dolibarr_print_phone($objsoc->fax).'&nbsp;</td></tr>';
print "<tr><td>Web</td><td colspan=\"3\"><a href=\"http://$objsoc->url\">$objsoc->url</a>&nbsp;</td></tr>"; print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$objsoc->url\">$objsoc->url</a>&nbsp;</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>";
@@ -220,7 +228,7 @@ if ($_socid > 0)
print "</td></tr>"; print "</td></tr>";
print "<tr><td>Type</td><td> $objsoc->typent</td><td>Effectif</td><td>$objsoc->effectif</td></tr>"; print "<tr><td>".$langs->trans("Type")."</td><td> $objsoc->typent</td><td>Effectif</td><td>$objsoc->effectif</td></tr>";
print "</table>"; print "</table>";
@@ -241,7 +249,7 @@ if ($_socid > 0)
* *
*/ */
$var = true; $var = true;
print '<table border="0" width="100%" cellspacing="0" cellpadding="1">'; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="1">';
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.remise, ".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.remise, ".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
$sql .= " AND s.idp = ".$objsoc->id." ORDER BY p.datep DESC"; $sql .= " AND s.idp = ".$objsoc->id." ORDER BY p.datep DESC";
@@ -319,7 +327,7 @@ if ($_socid > 0)
$sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do"; $sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p WHERE p.fk_soc = $objsoc->id"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p WHERE p.fk_soc = $objsoc->id";
if ( $db->query($sql) ) { if ( $db->query($sql) ) {
print "<table border=1 cellspacing=0 width=100% cellpadding=\"1\">"; print "<table class=\"border\" cellspacing=0 width=100% cellpadding=\"1\">";
$i = 0 ; $i = 0 ;
$num = $db->num_rows(); $num = $db->num_rows();
if ($num > 0) { if ($num > 0) {
@@ -400,12 +408,14 @@ if ($_socid > 0)
* Liste des contacts * Liste des contacts
* *
*/ */
print '<table width="100%" cellspacing="1" border="0" cellpadding="2">'; print '<table class="noborder" width="100%" cellspacing="1" cellpadding="2">';
print '<tr class="liste_titre"><td>'.$langs->trans("Firstname").' '.$langs->trans("Lastname").'</td>'; print '<tr class="liste_titre"><td>'.$langs->trans("Firstname").' '.$langs->trans("Lastname").'</td>';
print '<td>Poste</td><td>'.$langs->trans("Tel").'</td>'; print '<td>'.$langs->trans("Poste").'</td><td>'.$langs->trans("Tel").'</td>';
print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>'; print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>';
print "<td align=\"center\"><a href=\"".DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid."&amp;action=create\">".$langs->trans("AddContact")."</a></td></tr>"; print "<td align=\"center\"><a href=\"".DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid."&amp;action=create\">".$langs->trans("AddContact")."</a></td>";
print '<td>&nbsp;</td>';
print "</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->id 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->id ORDER by p.datec";
$result = $db->query($sql); $result = $db->query($sql);
@@ -417,9 +427,9 @@ if ($_socid > 0)
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td>'; print '<td>';
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->idp.'">'; print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->idp.'">';
print img_file(); print img_file();
print '</a>&nbsp;<a href="action/fiche.php?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.$obj->firstname.' '. $obj->name.'</a>&nbsp;'; print '&nbsp;'.$obj->firstname.' '. $obj->name.'</a>&nbsp;';
if ($obj->note) if ($obj->note)
{ {
@@ -430,10 +440,16 @@ if ($_socid > 0)
print '<td><a href="action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.$obj->phone.'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.$obj->phone.'</a>&nbsp;</td>';
print '<td><a href="action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.$obj->fax.'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.$obj->fax.'</a>&nbsp;</td>';
print '<td><a href="action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.$obj->email.'</a>&nbsp;</td>';
print "<td align=\"center\">";
print '<td align="center">';
print "<a href=\"../contact/fiche.php?action=edit&amp;id=$obj->idp\">"; print "<a href=\"../contact/fiche.php?action=edit&amp;id=$obj->idp\">";
print img_edit(); print img_edit();
print '</a></td>'; print '</a></td>';
print '<td align="center"><a href="action/fiche.php?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$objsoc->id.'">';
print img_actions();
print '</a></td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
$tag = !$tag; $tag = !$tag;
@@ -472,19 +488,19 @@ if ($_socid > 0)
if ($oldyear == strftime("%Y",$obj->da) ) { if ($oldyear == strftime("%Y",$obj->da) ) {
print '<td align="center">|</td>'; print '<td align="center">|</td>';
} else { } else {
print "<TD align=\"center\">" .strftime("%Y",$obj->da)."</TD>\n"; print "<td align=\"center\">" .strftime("%Y",$obj->da)."</TD>\n";
$oldyear = strftime("%Y",$obj->da); $oldyear = strftime("%Y",$obj->da);
} }
if ($oldmonth == strftime("%Y%b",$obj->da) ) { if ($oldmonth == strftime("%Y%b",$obj->da) ) {
print '<td align="center">|</td>'; print '<td align="center">|</td>';
} else { } else {
print "<TD align=\"center\">" .strftime("%b",$obj->da)."</TD>\n"; print "<td align=\"center\">" .strftime("%b",$obj->da)."</TD>\n";
$oldmonth = strftime("%Y%b",$obj->da); $oldmonth = strftime("%Y%b",$obj->da);
} }
print "<TD>" .strftime("%d",$obj->da)."</TD>\n"; print "<td>" .strftime("%d",$obj->da)."</td>\n";
print "<TD>" .strftime("%H:%M",$obj->da)."</TD>\n"; print "<td>" .strftime("%H:%M",$obj->da)."</td>\n";
print '<td width="10%">&nbsp;</td>'; print '<td width="10%">&nbsp;</td>';

View File

@@ -366,12 +366,14 @@ if ($socid > 0)
* Liste des contacts * Liste des contacts
* *
*/ */
print '<table class="noborder" width="100%" cellspacing="1" cellpadding="2">'; print '<table class="noborder" width="100%" cellspacing="1" cellpadding="2">';
print '<tr class="liste_titre"><td><b>Pr&eacute;nom Nom</b></td>'; print '<tr class="liste_titre"><td>'.$langs->trans("Firstname").' '.$langs->trans("Lastname").'</td>';
print '<td><b>Poste</b></td><td><b>T&eacute;l</b></td>'; print '<td>'.$langs->trans("Poste").'</td><td>'.$langs->trans("Tel").'</td>';
print "<td><b>Fax</b></td><td><b>Email</b></td>"; print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>';
print "<td align=\"center\"><a href=\"".DOL_URL_ROOT.'/contact/fiche.php?socid='.$societe->id."&amp;action=create\">".$langs->trans("AddContact")."</a></td></tr>"; print "<td align=\"center\"><a href=\"".DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid."&amp;action=create\">".$langs->trans("AddContact")."</a></td>";
print '<td>&nbsp;</td>';
print "</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 = $societe->id 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 = $societe->id ORDER by p.datec";
$result = $db->query($sql); $result = $db->query($sql);
@@ -385,9 +387,10 @@ if ($socid > 0)
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td>'; print '<td>';
//print '<a href="action/fiche.php?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$societe->id.'">'; print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->idp.'">';
//print '<img border="0" src="/theme/'.$conf->theme.'/img/filenew.png"></a>&nbsp;'; print img_file();
print '<a href="../comm/action/fiche.php?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->firstname.' '. $obj->name.'</a>'; print '&nbsp;'.$obj->firstname.' '. $obj->name.'</a>&nbsp;';
if ($obj->note) if ($obj->note)
{ {
print "<br>".nl2br($obj->note); print "<br>".nl2br($obj->note);
@@ -397,7 +400,16 @@ if ($socid > 0)
print '<td><a href="../comm/action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->phone.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->phone.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>';
print "<td align=\"center\"><a href=\"../contact/fiche.php?action=edit&amp;id=$obj->idp\">".img_edit()."</a></td>";
print '<td align="center">';
print "<a href=\"../contact/fiche.php?action=edit&amp;id=$obj->idp\">";
print img_edit();
print '</a></td>';
print '<td align="center"><a href="action/fiche.php?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$objsoc->id.'">';
print img_actions();
print '</a></td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
$tag = !$tag; $tag = !$tag;

View File

@@ -245,6 +245,18 @@ function dolibarr_print_phone($phone)
} }
} }
/*!
\brief Affiche logo d<>di<64> aux actions
*/
function img_actions($alt = "default")
{
if ($alt="default") {
global $langs;
$alt=$langs->trans("Rendez-vous");
}
return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/object_actions.png" border="0" alt="'.$alt.'" title="'.$alt.'">';
}
/*! /*!
\brief Affiche logo fichier \brief Affiche logo fichier
*/ */