";
print "propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."\n";
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 )
@@ -307,7 +305,7 @@ if ($_socid > 0)
$var=!$var;
$i++;
}
- $db->free();
+ $db->free($resql);
}
else {
dolibarr_print_error($db);
@@ -320,7 +318,7 @@ if ($_socid > 0)
*/
if($conf->commande->enabled)
{
- print '';
+ print '';
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.total_ht, p.ref, ".$db->pdate("p.date_commande")." as dp";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as p";
@@ -328,10 +326,11 @@ if ($_socid > 0)
$sql .= " AND s.idp = $objsoc->id";
$sql .= " ORDER BY p.date_commande DESC";
- if ( $db->query($sql) )
+ $resql=$db->query($sql);
+ if ($resql)
{
$var=true;
- $num = $db->num_rows();
+ $num = $db->num_rows($resql);
if ($num >0 )
{
print '';
@@ -341,7 +340,7 @@ if ($_socid > 0)
$i = 0; $now = time(); $lim = 3600 * 24 * 15 ;
while ($i < $num && $i < $MAXLIST)
{
- $objp = $db->fetch_object();
+ $objp = $db->fetch_object($resql);
$var=!$var;
print " ";
print '| '.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n";
@@ -354,17 +353,61 @@ if ($_socid > 0)
print ' | '.$objp->statut.' | ';
$i++;
}
- $db->free();
+ $db->free($resql);
}
print " ";
}
+ /*
+ * Dernieres interventions
+ */
+ if ($conf->fichinter->enabled)
+ {
+ print '';
+
+ $sql = "SELECT s.nom, s.idp, f.rowid as id, f.ref, ".$db->pdate("f.datei")." as di";
+ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
+ $sql .= " WHERE f.fk_soc = s.idp";
+ $sql .= " AND s.idp = ".$objsoc->id;
+ $sql .= " ORDER BY f.datei DESC";
+
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $var=true;
+ $num = $db->num_rows($resql);
+ if ($num >0 )
+ {
+ print '';
+ print ' | ';
+ print ' ';
+ $var=!$var;
+ }
+ $i = 0; $now = time(); $lim = 3600 * 24 * 15 ;
+ while ($i < $num && $i < $MAXLIST)
+ {
+ $objp = $db->fetch_object($resql);
+ print "";
+ print '| id."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."\n";
+ print " | ".dolibarr_print_date($objp->di)." | \n";
+ print ' ';
+ $var=!$var;
+ $i++;
+ }
+ $db->free($resql);
+ }
+ else {
+ dolibarr_print_error($db);
+ }
+ print " ";
+ }
+
/*
* Derniers projets associés
*/
if ($conf->projet->enabled)
{
- print '';
+ print '';
$sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
@@ -543,9 +586,7 @@ if ($_socid > 0)
*
*/
print '';
- print '| '.$langs->trans("ActionsToDo").' | '.$langs->trans("AddActionToDo").' | ';
- print '';
- print '| ';
+ print ' | | '.$langs->trans("ActionsToDo").' | '.$langs->trans("AddActionToDo").' | ';
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, 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 ";
@@ -555,11 +596,13 @@ if ($_socid > 0)
$sql .= " ORDER BY a.datea DESC, a.id DESC";
$result=$db->query($sql);
- if ($result) {
- print "\n";
-
- $i = 0 ; $num = $db->num_rows($result);
- while ($i < $num) {
+ if ($result)
+ {
+ $i = 0 ;
+ $num = $db->num_rows($result);
+
+ while ($i < $num)
+ {
$var = !$var;
$obj = $db->fetch_object($result);
@@ -590,11 +633,11 @@ if ($_socid > 0)
print "| " .strftime("%d",$obj->da)." | \n";
print "" .strftime("%H:%M",$obj->da)." | \n";
- print ' | ';
+ print ' | ';
if ($obj->propalrowid)
{
- print ''.img_object($langs->trans("ShowTask"),"task");
+ print ' | '.img_object($langs->trans("ShowTask"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
@@ -602,27 +645,23 @@ if ($_socid > 0)
}
else
{
- print ' | '.img_object($langs->trans("ShowTask"),"task");
+ print ' | '.img_object($langs->trans("ShowTask"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print ' | ';
}
- /*
- * Contact pour cette action
- *
- */
+
+ // 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.' | ';
+ print ''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' | ';
} else {
- print ' | ';
+ print ' | ';
}
- /*
- */
- print ''.$obj->code.' | ';
+ print ''.$obj->code.' | ';
print "\n";
$i++;
}
@@ -632,15 +671,13 @@ if ($_socid > 0)
} else {
dolibarr_print_error($db);
}
- print " ";
+ print " ";
/*
* Listes des actions effectuees
*/
print '';
- print '| '.$langs->trans("ActionsDone").' | ';
- print '';
- print '| ';
+ print ' | | '.$langs->trans("ActionsDone").' | ';
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, 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 ";
@@ -652,12 +689,12 @@ if ($_socid > 0)
$result=$db->query($sql);
if ($result)
{
- print '';
-
$i = 0 ;
$num = $db->num_rows($result);
$oldyear='';
$oldmonth='';
+ $var=true;
+
while ($i < $num)
{
$var = !$var;
@@ -665,34 +702,34 @@ if ($_socid > 0)
$obj = $db->fetch_object($result);
print "";
+ // Champ date
if ($oldyear == strftime("%Y",$obj->da) )
{
- print '| | | ';
+ print '| | ';
}
else
{
- print "" .strftime("%Y",$obj->da)." | \n";
+ print ''.strftime("%Y",$obj->da)." | \n";
$oldyear = strftime("%Y",$obj->da);
}
if ($oldmonth == strftime("%Y%b",$obj->da) )
{
- print '| | ';
+ print '| | ';
}
else
{
- print "" .strftime("%b",$obj->da)." | \n";
+ print ''.strftime("%b",$obj->da)." | \n";
$oldmonth = strftime("%Y%b",$obj->da);
}
+ print ''.strftime("%d",$obj->da)." | \n";
+ print ''.strftime("%H:%M",$obj->da)." | \n";
- print "" .strftime("%d",$obj->da)." | \n";
- print "" .strftime("%H:%M",$obj->da)." | \n";
-
- print ' | ';
+ print ' | ';
if ($obj->propalrowid)
{
- print ''.img_object($langs->trans("ShowTask"),"task");
+ print ' | '.img_object($langs->trans("ShowTask"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
@@ -700,33 +737,29 @@ if ($_socid > 0)
}
else
{
- print ' | '.img_object($langs->trans("ShowTask"),"task");
+ print ' | '.img_object($langs->trans("ShowTask"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print ' | ';
}
- /*
- * Contact pour cette action
- *
- */
+
+ // 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.' | ';
+ print ''.img_object($langs->trans("Showcontact"),"contact").' '.$contact->fullname.' | ';
}
else
{
- print ' | ';
+ print ' | ';
}
- /*
- */
- print ''.$obj->code.' | ';
+
+ print ''.$obj->code.' | ';
print " \n";
$i++;
}
- print " ";
$db->free($result);
}
@@ -734,20 +767,17 @@ if ($_socid > 0)
{
dolibarr_print_error($db);
}
- print " ";
+ print " ";
+ // Notes sur la societe
/*
- *
- * Notes sur la societe
- *
- */
if ($objsoc->note)
{
print '';
print "| ".nl2br($objsoc->note)." | ";
print " ";
}
-
+ */
}
} else {
dolibarr_print_error($db);
@@ -755,5 +785,6 @@ if ($_socid > 0)
$db->close();
-llxFooter("Dernière modification $Date$ révision $Revision$");
+
+llxFooter('$Date$ - $Revision$');
?>
|