';
-
+
print '';
print '| '.$langs->trans("Name").' | '.$societe->nom.' | ';
-
- print '| '.$langs->trans('Prefix').' | '.$societe->prefix_comm.' | ';
- if ($societe->fournisseur)
- {
- print '| ';
- print $langs->trans('SupplierCode').' | ';
- print $societe->code_fournisseur;
- if ($societe->check_codefournisseur() <> 0) print ' '.$langs->trans("WrongSupplierCode");
- print ' | ';
- }
-
+ print '| '.$langs->trans('Prefix').' | '.$societe->prefix_comm.' | ';
+
+ if ($societe->fournisseur)
+ {
+ print '| ';
+ print $langs->trans('SupplierCode').' | ';
+ print $societe->code_fournisseur;
+ if ($societe->check_codefournisseur() <> 0) print ' '.$langs->trans("WrongSupplierCode");
+ print ' | ';
+ }
+
print '| '.$langs->trans("Address").' | '.nl2br($societe->adresse).' | ';
-
+
print '| '.$langs->trans("Zip").' | '.$societe->cp.' | ';
print ''.$langs->trans("Town").' | '.$societe->ville.' | ';
print '| '.$langs->trans("Country").' | '.$societe->pays.' | ';
@@ -170,79 +173,79 @@ if ( $societe->fetch($socid) )
print '';
- $var=true;
+ $var=true;
- $MAXLIST=4;
-
- // Lien recap
- print '';
- print '';
- print ' | ';
- print ' ';
- print ' ';
- print ' ';
+ $MAXLIST=4;
- /*
- * Liste des commandes associées
- */
+ // Lien recap
+ print '';
+ print '';
+ print ' | ';
+ print ' ';
+ print ' ';
+ print ' ';
+
+ /*
+ * Liste des commandes associées
+ */
$orderstatic = new CommandeFournisseur($db);
- $sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut";
- $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
- $sql.= " WHERE p.fk_soc =".$societe->id;
- $sql.= " ORDER BY p.rowid";
- $sql.= " ".$db->plimit($MAXLIST);
- $resql=$db->query($sql);
- if ($resql)
- {
- $i = 0 ;
- $num = $db->num_rows($resql);
- if ($num > 0)
- {
- print '';
- print '';
- print '| ';
- print '';
- print ' | ';
- }
- while ($i < $num && $i <= $MAXLIST)
- {
- $obj = $db->fetch_object($resql);
- $var=!$var;
-
- print "";
- print '| '.img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref.' | ';
- print '';
- if ($obj->dc)
- {
- print dolibarr_print_date($obj->dc);
- }
- else
- {
- print "-";
- }
- print ' | ';
+ $sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut";
+ $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
+ $sql.= " WHERE p.fk_soc =".$societe->id;
+ $sql.= " ORDER BY p.rowid";
+ $sql.= " ".$db->plimit($MAXLIST);
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $i = 0 ;
+ $num = $db->num_rows($resql);
+ if ($num > 0)
+ {
+ print '';
+ print '';
+ print '| ';
+ print '';
+ print ' | ';
+ }
+ while ($i < $num && $i <= $MAXLIST)
+ {
+ $obj = $db->fetch_object($resql);
+ $var=!$var;
+
+ print "";
+ print '| '.img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref.' | ';
+ print '';
+ if ($obj->dc)
+ {
+ print dolibarr_print_date($obj->dc);
+ }
+ else
+ {
+ print "-";
+ }
+ print ' | ';
print ''.$orderstatic->LibStatut($obj->fk_statut,5).' | ';
- print ' ';
- $i++;
- }
- $db->free($resql);
- if ($num > 0)
- {
- print " ";
- }
- }
- else
- {
- dolibarr_print_error($db);
- }
+ print ' ';
+ $i++;
+ }
+ $db->free($resql);
+ if ($num > 0)
+ {
+ print " ";
+ }
+ }
+ else
+ {
+ dolibarr_print_error($db);
+ }
- /*
- * Liste des factures associées
- */
+ /*
+ * Liste des factures associées
+ */
$MAXLIST=5;
$langs->load('bills');
@@ -293,15 +296,15 @@ if ( $societe->fetch($socid) )
/*
* Liste des produits
*/
- if ($conf->produit->enabled || $conf->service->enabled)
- {
- $langs->load("products");
- print ' ';
- }
+ if ($conf->produit->enabled || $conf->service->enabled)
+ {
+ $langs->load("products");
+ print ' ';
+ }
print ' | ';
print ' ' . "\n";
@@ -313,98 +316,311 @@ if ( $societe->fetch($socid) )
* Barre d'actions
*
*/
-
+
print '';
- /*
- *
- * Liste des contacts
- *
- */
+ /*
+ *
+ * Liste des contacts
+ *
+ */
$langs->load("companies");
-
+
print '
';
-
+
print '| '.$langs->trans("Firstname").' '.$langs->trans("Lastname").' | ';
print ''.$langs->trans("Poste").' | '.$langs->trans("Tel").' | ';
print "".$langs->trans("Fax")." | ".$langs->trans("EMail")." | ";
print " | ";
print ' | ';
print " ";
-
- $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note";
- $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
- $sql.= " WHERE p.fk_soc = ".$societe->id;
- $sql.= " ORDER by p.datec";
- $result = $db->query($sql);
+ $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note";
+ $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
+ $sql.= " WHERE p.fk_soc = ".$societe->id;
+ $sql.= " ORDER by p.datec";
- $i = 0 ;
- $num = $db->num_rows($result);
- $var=true;
-
- while ($i < $num)
- {
- $obj = $db->fetch_object($result);
- $var = !$var;
+ $result = $db->query($sql);
- print "";
+ $i = 0 ;
+ $num = $db->num_rows($result);
+ $var=true;
- print '| ';
- print '';
- print img_object($langs->trans("ShowContact"),"contact");
- print ' '.$obj->firstname.' '. $obj->name.' ';
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($result);
+ $var = !$var;
- if ($obj->note)
+ print " | ";
+
+ print '';
+ print '';
+ print img_object($langs->trans("ShowContact"),"contact");
+ print ' '.$obj->firstname.' '. $obj->name.' ';
+
+ if ($obj->note)
+ {
+ print " ".nl2br($obj->note);
+ }
+ print " | ";
+ print "$obj->poste | ";
+ print ''.$obj->phone.' | ';
+ print ''.$obj->fax.' | ';
+ print ''.$obj->email.' | ';
+
+ if ($user->rights->societe->contact->creer)
+ {
+ print "idp\">".img_edit()." | ";
+ }
+
+ print '';
+ print img_object($langs->trans("Rendez-Vous"),"action");
+ print ' | ';
+
+ print " \n";
+ $i++;
+ }
+ print ' ';
+ print ' ';
+
+ /*
+ * Listes des actions a faire
+ *
+ */
+ print '';
+ print '| '.$langs->trans("ActionsToDo").' | | ';
+
+ $sql = "SELECT a.id, a.label, ".$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 ";
+ $sql .= " WHERE a.fk_soc = ".$societe->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);
+ $var=true;
+
+ while ($i < $num)
+ {
+ $var = !$var;
+
+ $obj = $db->fetch_object($result);
+ print "";
+
+ if ($oldyear == strftime("%Y",$obj->da) )
{
- print " ".nl2br($obj->note);
+ print '| | ';
+ }
+ else
+ {
+ print ''.strftime("%Y",$obj->da)." | \n";
+ $oldyear = strftime("%Y",$obj->da);
}
- print "";
- print "$obj->poste | ";
- print ''.$obj->phone.' | ';
- print ''.$obj->fax.' | ';
- print ''.$obj->email.' | ';
-
- if ($user->rights->societe->contact->creer)
- {
- print "idp\">".img_edit()." | ";
- }
-
- print '';
- print img_object($langs->trans("Rendez-Vous"),"action");
- print ' | ';
- print " \n";
- $i++;
- }
- print " ";
+ if ($oldmonth == strftime("%Y%b",$obj->da) )
+ {
+ print ' | | | ';
+ }
+ else
+ {
+ print '' .strftime("%b",$obj->da)." | \n";
+ $oldmonth = strftime("%Y%b",$obj->da);
+ }
+
+ print ''.strftime("%d",$obj->da)." | \n";
+ print ''.strftime("%H:%M",$obj->da).' | ';
+
+ // Picto warning
+ print '';
+ if (date("U",$obj->da) < 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 ' | ';
+ }
+
+ // Auteur
+ print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.' | ';
+ print "
\n";
+ $i++;
+ }
+
+ $db->free($result);
+ } else {
+ dolibarr_print_error($db);
+ }
+ print "