";
+
+ print '';
+ print '';
+ print img_object($langs->trans("Show"),"contact");
+ print ' '.$obj->firstname.' '. $obj->name.' ';
+
+ if (trim($obj->note))
{
- $user->fetch_clicktodial(); // lecture des infos de clicktodial
+ print ' '.nl2br(trim($obj->note));
}
+ print ' | ';
+ print ''.$obj->poste.' | ';
+ print '';
- print_titre($langs->trans("ContactsForCompany"));
- print '";
+
+ print " ";
+
+
+ $actionstatic=new ActionComm($db);
+
+ /*
+ * Listes des actions a faire
+ *
+ */
+ print_titre($langs->trans("ActionsOnCompany"));
+
+ print '';
+ print '';
+ print '| '.$langs->trans("ActionsToDoShort").' | | ';
+ print ' ';
+
+ $sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, a.percent,";
+ $sql.= " c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
+ $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
+ $sql.= " WHERE a.fk_soc = ".$objsoc->id;
+ $sql.= " AND u.rowid = a.fk_user_author";
+ $sql.= " AND c.id=a.fk_action AND a.percent < 100";
+ $sql.= " ORDER BY a.datep DESC, a.id DESC";
+
+ $result=$db->query($sql);
+ if ($result)
+ {
+ $i = 0 ;
$num = $db->num_rows($result);
$var=true;
-
- while ($i < $num)
+
+ if ($num)
{
- $obj = $db->fetch_object($result);
- $var = !$var;
- print "";
-
- print '';
- print '';
- print img_object($langs->trans("Show"),"contact");
- print ' '.$obj->firstname.' '. $obj->name.' ';
-
- if (trim($obj->note))
- {
- print ' '.nl2br(trim($obj->note));
- }
- print ' | ';
- print ''.$obj->poste.' | ';
- print '';
-
- // Lien click to dial
- if (strlen($obj->phone) && $user->clicktodial_enabled == 1)
- {
- print '';
- print img_phone_out("Appel émis") ;
- }
- print ' | ';
- print ''.dolibarr_print_phone($obj->phone).' | ';
- print ''.dolibarr_print_phone($obj->fax).' | ';
- print ''.$obj->email.' | ';
-
- print '';
- print "idp\">";
- print img_edit();
- print ' | ';
-
- print '';
- print img_object($langs->trans("Rendez-Vous"),"action");
- print ' | ';
-
- print " \n";
- $i++;
- }
- print " ";
-
- print " ";
-
-
- $actionstatic=new ActionComm($db);
-
- /*
- * Listes des actions a faire
- *
- */
- print_titre($langs->trans("ActionsOnCompany"));
-
- print '';
- print '';
- print '| '.$langs->trans("ActionsToDoShort").' | | ';
- print ' ';
-
- $sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, a.percent,";
- $sql.= " c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
- $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
- $sql.= " WHERE a.fk_soc = ".$objsoc->id;
- $sql.= " AND u.rowid = a.fk_user_author";
- $sql.= " AND c.id=a.fk_action AND a.percent < 100";
- $sql.= " ORDER BY a.datep DESC, a.id DESC";
-
- $result=$db->query($sql);
- if ($result)
- {
- $i = 0 ;
- $num = $db->num_rows($result);
- $var=true;
-
- if ($num)
- {
- while ($i < $num)
- {
- $var = !$var;
-
- $obj = $db->fetch_object($result);
- print "";
-
- if ($oldyear == strftime("%Y",$obj->dp) )
- {
- print '| | | ';
- }
- else
- {
- print ''.strftime("%Y",$obj->dp)." | \n";
- $oldyear = strftime("%Y",$obj->dp);
- }
-
- if ($oldmonth == strftime("%Y%b",$obj->dp) )
- {
- print '| | ';
- }
- else
- {
- print '' .strftime("%b",$obj->dp)." | \n";
- $oldmonth = strftime("%Y%b",$obj->dp);
- }
-
- print ''.strftime("%d",$obj->dp)." | \n";
- print ''.strftime("%H:%M",$obj->dp).' | ';
-
- // Picto warning
- print '';
- if (date("U",$obj->dp) < time()) print ' '.img_warning("Late");
- else print ' ';
- print ' | ';
-
- // Status/Percent
- print ' | ';
-
- if ($obj->propalrowid)
- {
- print ''.img_object($langs->trans("ShowAction"),"task");
- $transcode=$langs->trans("Action".$obj->acode);
- $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
- print $libelle;
- print ' | ';
- }
- else
- {
- print ''.img_object($langs->trans("ShowAction"),"task");
- $transcode=$langs->trans("Action".$obj->acode);
- $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
- print $libelle;
- print ' | ';
- }
- print ''.$obj->label.' | ';
-
- // Contact pour cette action
- if ($obj->fk_contact) {
- $contact = new Contact($db);
- $contact->fetch($obj->fk_contact);
- print ''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' | ';
- } else {
- print ' | ';
- }
-
- print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.' | ';
-
- // Statut
- print ''.$actionstatic->LibStatut($obj->percent,3).' | ';
-
- print " \n";
- $i++;
- }
- }
- else
- {
- // Aucun action à faire
-
- }
- $db->free($result);
- } else {
- dolibarr_print_error($db);
- }
- print " ";
-
- print " ";
-
-
- /*
- * Listes des actions effectuees
- */
- print '';
- print '';
- print '| '.$langs->trans("ActionsDoneShort").' | ';
- print ' ';
-
- $sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, a.percent,";
- $sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,";
- $sql.= " c.code as acode, c.libelle,";
- $sql.= " u.code, u.rowid";
- $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
- $sql.= " WHERE a.fk_soc = ".$objsoc->id;
- $sql.= " AND u.rowid = a.fk_user_author";
- $sql.= " AND c.id=a.fk_action AND a.percent = 100";
- $sql.= " ORDER BY a.datea DESC, a.id DESC";
-
- $result=$db->query($sql);
- if ($result)
- {
- $i = 0 ;
- $num = $db->num_rows($result);
- $oldyear='';
- $oldmonth='';
- $var=true;
-
while ($i < $num)
{
$var = !$var;
@@ -905,97 +773,216 @@ if ($socidp > 0)
$obj = $db->fetch_object($result);
print "";
- // Champ date
- if ($oldyear == strftime("%Y",$obj->da) )
+ if ($oldyear == strftime("%Y",$obj->dp) )
{
print '| | | ';
}
else
{
- print ''.strftime("%Y",$obj->da)." | \n";
- $oldyear = strftime("%Y",$obj->da);
+ print ''.strftime("%Y",$obj->dp)." | \n";
+ $oldyear = strftime("%Y",$obj->dp);
}
- if ($oldmonth == strftime("%Y%b",$obj->da) )
+ if ($oldmonth == strftime("%Y%b",$obj->dp) )
{
print '| | ';
}
else
{
- print ''.strftime("%b",$obj->da)." | \n";
- $oldmonth = strftime("%Y%b",$obj->da);
+ print '' .strftime("%b",$obj->dp)." | \n";
+ $oldmonth = strftime("%Y%b",$obj->dp);
}
- print ''.strftime("%d",$obj->da)." | \n";
- print ''.strftime("%H:%M",$obj->da)." | \n";
- // Picto
- print ' | ';
-
- // Espace
- print ' | ';
-
- // Action
- print '';
- print ''.img_object($langs->trans("ShowTask"),"task");
- $transcode=$langs->trans("Action".$obj->acode);
- $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
- print $libelle;
- print '';
+ print ' | '.strftime("%d",$obj->dp)." | \n";
+ print ''.strftime("%H:%M",$obj->dp).' | ';
+
+ // Picto warning
+ print '';
+ if (date("U",$obj->dp) < time()) print ' '.img_warning("Late");
+ else print ' ';
print ' | ';
- // Objet lié
- print '';
- if ($obj->propalrowid)
- {
- print ''.img_object($langs->trans("ShowPropal"),"propal");
- print $langs->trans("Propal");
- print '';
- }
- if ($obj->fk_facture)
- {
- print ''.img_object($langs->trans("ShowBill"),"bill");
- print $langs->trans("Invoice");
- print '';
- }
- else print ' ';
- print ' | ';
+ // Status/Percent
+ print ' | ';
- // Libellé
- print "$obj->label | ";
+ if ($obj->propalrowid)
+ {
+ print ''.img_object($langs->trans("ShowAction"),"task");
+ $transcode=$langs->trans("Action".$obj->acode);
+ $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
+ print $libelle;
+ print ' | ';
+ }
+ else
+ {
+ print ''.img_object($langs->trans("ShowAction"),"task");
+ $transcode=$langs->trans("Action".$obj->acode);
+ $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
+ print $libelle;
+ print ' | ';
+ }
+ print ''.$obj->label.' | ';
// Contact pour cette action
- if ($obj->fk_contact)
- {
+ if ($obj->fk_contact) {
$contact = new Contact($db);
$contact->fetch($obj->fk_contact);
print ''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' | ';
- }
- else
- {
+ } else {
print ' | ';
}
- // Auteur
- print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.' | ';
+ print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.' | ';
// Statut
print ''.$actionstatic->LibStatut($obj->percent,3).' | ';
-
+
print " \n";
$i++;
}
-
- $db->free($result);
- }
- else
- {
- dolibarr_print_error($db);
- }
- print " ";
-
+ }
+ else
+ {
+ // Aucun action à faire
+
+ }
+ $db->free($result);
}
-} else {
- dolibarr_print_error($db);
+ else
+ {
+ dolibarr_print_error($db);
+ }
+ print " |