* Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2006 Andre Cianfarani * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ */ /** \file htdocs/comm/fiche.php \ingroup commercial \brief Onglet client de la fiche societe \version $Revision$ */ require_once("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); $langs->load("companies"); $langs->load("orders"); $langs->load("bills"); $langs->load("contracts"); if ($conf->fichinter->enabled) $langs->load("interventions"); $user->getrights("commercial"); if (!$user->rights->societe->lire) accessforbidden(); $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($socid == '') accessforbidden(); // Protection quand utilisateur externe if ($user->societe_id > 0) { $socid = $user->societe_id; } // Protection restriction commercial if (!$user->rights->commercial->client->voir && $socid && !$user->societe_id > 0) { $sql = "SELECT sc.fk_soc, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE sc.fk_soc = ".$socid." AND sc.fk_user = ".$user->id." AND s.client = 1"; if ( $db->query($sql) ) { if ( $db->num_rows() == 0) accessforbidden(); } } $sortorder=$_GET["sortorder"]; $sortfield=$_GET["sortfield"]; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="nom"; /* * Actions */ if ($_GET["action"] == 'attribute_prefix' && $user->rights->societe->creer) { $societe = new Societe($db, $_GET["socid"]); $societe->attribute_prefix($db, $_GET["socid"]); } // conditions de règlement if ($_POST["action"] == 'setconditions' && $user->rights->societe->creer) { $societe = new Societe($db, $_GET["socid"]); $societe->cond_reglement=$_POST['cond_reglement_id']; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET cond_reglement='".$_POST['cond_reglement_id']; $sql.= "' WHERE idp='".$_GET["socid"]."'"; $result = $db->query($sql); if (! $result) dolibarr_print_error($result); } // mode de règlement if ($_POST["action"] == 'setmode' && $user->rights->societe->creer) { $societe = new Societe($db, $_GET["socid"]); $societe->mode_reglement=$_POST['mode_reglement_id']; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET mode_reglement='".$_POST['mode_reglement_id']; $sql.= "' WHERE idp='".$_GET["socid"]."'"; $result = $db->query($sql); if (! $result) dolibarr_print_error($result); } // assujétissement à la TVA if ($_POST["action"] == 'setassujtva' && $user->rights->societe->creer) { $societe = new Societe($db, $_GET["socid"]); $societe->tva_assuj=$_POST['assujtva_value']; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET tva_assuj='".$_POST['assujtva_value']."' WHERE idp='".$socid."'"; $result = $db->query($sql); if (! $result) dolibarr_print_error($result); } if ($action == 'stcomm') { if ($stcommid <> 'null' && $stcommid <> $oldstcomm) { $sql = "INSERT INTO socstatutlog (datel, fk_soc, fk_statut, author) "; $sql .= " VALUES ('$dateaction',$socid,$stcommid,'" . $user->login . "')"; $result = @$db->query($sql); if ($result) { $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=$stcommid WHERE idp=".$socid; $result = $db->query($sql); } else { $errmesg = "ERREUR DE DATE !"; } } if ($actioncommid) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')"; $result = @$db->query($sql); if (!$result) { $errmesg = "ERREUR DE DATE !"; } } } /* * Recherche * */ if ($mode == 'search') { if ($mode-search == 'soc') { $sql = "SELECT s.idp"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; } if ( $db->query($sql) ) { if ( $db->num_rows() == 1) { $obj = $db->fetch_object(); $socid = $obj->idp; } $db->free(); } } /********************************************************************************* * * Mode fiche * *********************************************************************************/ llxHeader('',$langs->trans('CustomerCard')); $actionstatic=new ActionComm($db); $facturestatic=new Facture($db); $contactstatic = new Contact($db); $userstatic=new User($db); if ($socid > 0) { // On recupere les donnees societes par l'objet $objsoc = new Societe($db); $objsoc->id=$socid; $objsoc->fetch($socid,$to); $dac = strftime("%Y-%m-%d %H:%M", time()); if ($errmesg) { print "$errmesg
"; } /* * Affichage onglets */ $head = societe_prepare_head($objsoc); dolibarr_fiche_head($head, 'customer', $objsoc->nom); /* * * */ print ''; print '\n"; print '"; print "
'; print ''; print ''; print ''; if ($objsoc->client) { print ''; } print ""; print '"; print '"; if ($objsoc->pays) { print ''; } print ''; print ''; print '"; // Assujeti à TVA ou pas print ''; print ''; print ''; // Conditions de réglement par défaut $langs->load('bills'); $html = new Form($db); print '"; print ''; // Mode de règlement print '"; print ''; // Réductions relative (Remises-Ristournes-Rabbais) print ''; print ''; // Réductions absolues (Remises-Ristournes-Rabbais) print ''; print ''; print ''; // multiprix if($conf->global->PRODUIT_MULTIPRICES == 1) { print '"; print ''; } // Adresse de livraison if ($conf->expedition->enabled) { print ''; print ''; } print "
'.$langs->trans("Name").''; print $objsoc->nom; print '
'.$langs->trans('Prefix').''.$objsoc->prefix_comm.'
'; print $langs->trans('CustomerCode').''; print $objsoc->code_client; if ($objsoc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); print '
".$langs->trans('Address')."".nl2br($objsoc->adresse)."
'.$langs->trans('Zip').''.$objsoc->cp."'.$langs->trans('Town').''.$objsoc->ville."
'.$langs->trans('Country').''.$objsoc->pays.'
'.$langs->trans('Phone').''.dolibarr_print_phone($objsoc->tel,$objsoc->pays_code).''.$langs->trans('Fax').''.dolibarr_print_phone($objsoc->fax,$objsoc->pays_code).'
'.$langs->trans("Web")."url\" target=\"_blank\">".$objsoc->url." 
'.$langs->trans('VATIsUsed').''; print yn($objsoc->tva_assuj); print '
'; print ''; print '
'; print $langs->trans('PaymentConditions'); print ''; if (($_GET['action'] != 'editconditions') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; print '
'; if ($_GET['action'] == 'editconditions') { $html->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->cond_reglement,'cond_reglement_id',-1,1); } else { $html->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->cond_reglement,'none'); } print "
'; print ''; print '
'; print $langs->trans('PaymentMode'); print ''; if (($_GET['action'] != 'editmode') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetMode'),1).'
'; print '
'; if ($_GET['action'] == 'editmode') { $html->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->mode_reglement,'mode_reglement_id'); } else { $html->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->mode_reglement,'none'); } print "
'; print '
'; print $langs->trans("CustomerRelativeDiscountShort"); print ''; if ($user->rights->societe->creer) { print ''.img_edit($langs->trans("Modify")).''; } print '
'; print '
'.($objsoc->remise_client?$objsoc->remise_client.'%':$langs->trans("DiscountNone")).'
'; print ''; print '
'; print $langs->trans("CustomerAbsoluteDiscountShort"); print ''; if ($user->rights->societe->creer) { print ''.img_edit($langs->trans("Modify")).''; } print '
'; print '
'; $amount_discount=$objsoc->getcurrentDiscount(); if ($amount_discount < 0) dolibarr_print_error($db,$societe->error); if ($amount_discount > 0) print $amount_discount.' '.$langs->trans("Currency".$conf->monnaie); else print $langs->trans("DiscountNone"); print '
'; print '
'; print $langs->trans("PriceLevel"); print ''; if ($user->rights->societe->creer) { print ''.img_edit($langs->trans("Modify")).''; } print '
'; print '
'.$objsoc->price_level."
'; print '
'; print $langs->trans("DeliveriesAddress"); print ''; if ($user->rights->societe->creer) { print ''.img_edit($langs->trans("Modify")).''; } print '
'; print '
'; $sql = "SELECT count(rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_adresse_livraison"; $sql.= " WHERE fk_societe =".$objsoc->id; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $objal = $db->fetch_object($resql); print $objal->nb?($objal->nb):$langs->trans("NoOtherDeliveryAddress"); } else { dolibarr_print_error($db); } print '
"; print "
'; // Nbre max d'éléments des petites listes $MAXLIST=4; // Lien recap print ''; print ''; print ''; print ''; print '
'; print '
'.$langs->trans("Summary").''.$langs->trans("ShowCustomerPreview").'
'; print '
'; /* * Dernieres propales */ if ($conf->propal->enabled) { $propal_static=new Propal($db); print ''; $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.fk_statut, p.price, p.ref, p.remise, "; $sql.= " ".$db->pdate("p.datep")." as dp, ".$db->pdate("p.fin_validite")." as datelimite"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id"; $sql .= " AND s.idp = ".$objsoc->id; $sql .= " ORDER BY p.datep DESC"; $resql=$db->query($sql); if ($resql) { $var=true; $num = $db->num_rows($resql); if ($num > 0) { print ''; print ''; print ''; $var=!$var; } $i = 0; while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); print ""; print "\n"; print ''; print ''; $var=!$var; $i++; } $db->free($resql); } else { dolibarr_print_error($db); } print "
'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPropals").' ('.$num.')
propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."\n"; if ( ($objp->dp < time() - $conf->propal->cloture->warning_delay) && $objp->fk_statut == 1 ) { print " ".img_warning(); } print ''.dolibarr_print_date($objp->dp)."'.price($objp->price).''.$propal_static->LibStatut($objp->fk_statut,5).'
"; } /* * Dernieres commandes */ if($conf->commande->enabled) { $commande_static=new Commande($db); print ''; $sql = "SELECT s.nom, s.idp,"; $sql.= " c.rowid as cid, c.total_ht, c.ref, c.fk_statut, c.facture,"; $sql.= " ".$db->pdate("c.date_commande")." as dc"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; $sql.= " WHERE c.fk_soc = s.idp "; $sql.= " AND s.idp = $objsoc->id"; $sql.= " ORDER BY c.date_commande DESC"; $resql=$db->query($sql); if ($resql) { $var=true; $num = $db->num_rows($resql); if ($num >0 ) { print ''; print ''; print ''; } $i = 0; while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); $var=!$var; print ""; print '\n"; print ''; print ''; $i++; } $db->free($resql); } else { dolibarr_print_error($db); } print "
'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' ('.$num.')
'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n"; print ''.dolibarr_print_date($objp->dc)."'.price($objp->total_ht).''.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'
"; } /* * Derniers contrats */ if($conf->contrat->enabled) { $contratstatic=new Contrat($db); print ''; $sql = "SELECT s.nom, s.idp, c.rowid as id, c.ref as ref, c.statut, ".$db->pdate("c.datec")." as dc"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql .= " WHERE c.fk_soc = s.idp "; $sql .= " AND s.idp = $objsoc->id"; $sql .= " ORDER BY c.datec DESC"; $resql=$db->query($sql); if ($resql) { $var=true; $num = $db->num_rows($resql); if ($num >0 ) { print ''; print ''; print ''; } $i = 0; while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); $var=!$var; print ""; print '\n"; print '\n"; print ''; print '\n"; print ''; $i++; } $db->free($resql); } else { dolibarr_print_error($db); } print "
'; print '
'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllContracts").' ('.$num.')
'.img_object($langs->trans("ShowContract"),"contract").' ' .(!isset($objp->ref) ? $objp->id : $objp->ref) ."'.dolibarr_print_date($objp->dc)." '.$contratstatic->LibStatut($objp->statut,5)."
"; } /* * 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; while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); print ""; print '\n"; print ''; $var=!$var; $i++; } $db->free($resql); } else { dolibarr_print_error($db); } print "
'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllInterventions").' ('.$num.')
".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."\n"; print "".dolibarr_print_date($objp->di)."
"; } /* * Derniers projets associés */ if ($conf->projet->enabled) { print ''; $sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " WHERE p.fk_soc = $objsoc->id"; $sql .= " ORDER BY p.dateo DESC"; $result=$db->query($sql); if ($result) { $var=true; $i = 0 ; $num = $db->num_rows($result); if ($num > 0) { print ''; print ''; print ''; } while ($i < $num && $i < $MAXLIST) { $obj = $db->fetch_object($result); $var = !$var; print ""; print ''; print ""; $i++; } $db->free($result); } else { dolibarr_print_error($db); } print "
'.$langs->trans("LastProjects",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllProjects").' ('.$num.')
'.img_object($langs->trans("ShowProject"),"project")." ".$obj->title.'".$obj->ref ."
"; } print "
\n"; /* * Barre d'action * */ print '
'; if ($conf->propal->enabled && $user->rights->propale->creer) { $langs->load("propal"); print ''.$langs->trans("AddProp").''; } if ($conf->commande->enabled && $user->rights->commande->creer) { $langs->load("orders"); print ''.$langs->trans("AddOrder").''; } if ($user->rights->contrat->creer) { $langs->load("contracts"); print ''.$langs->trans("AddContract").''; } if ($conf->fichinter->enabled && $user->rights->ficheinter->creer) { $langs->load("fichinter"); print ''.$langs->trans("AddIntervention").''; } print ''.$langs->trans("AddAction").''; if ($user->rights->societe->contact->creer) { print ''.$langs->trans("AddContact").''; } print '
'; print '
'; /* * * Liste des contacts * */ if ($conf->clicktodial->enabled) { $user->fetch_clicktodial(); // lecture des infos de clicktodial } print_titre($langs->trans("ContactsForCompany")); print ''; print ''; print ''; print ''; 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 = ".$objsoc->id; $sql .= " ORDER by p.datec"; $result = $db->query($sql); $i = 0; $num = $db->num_rows($result); $var=true; while ($i < $num) { $obj = $db->fetch_object($result); $var = !$var; print ""; $contactstatic->id=$obj->idp; $contactstatic->name=$obj->name; $contactstatic->firstname=$obj->firstname; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; $i++; } print "
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'  
'; print $contactstatic->getNomUrl(1); if (trim($obj->note)) { print '
'.nl2br(trim($obj->note)); } print '
'.$obj->poste.' '; // 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).' '.dolibarr_print_phone($obj->fax).' '.$obj->email.' '; print "idp\">"; print img_edit(); print ''; print img_object($langs->trans("Rendez-Vous"),"action"); print '
"; print "
"; /* * Listes des actions a faire * */ print_titre($langs->trans("ActionsOnCompany")); print ''; print ''; print ''; print ''; $sql = "SELECT a.id, a.label,"; $sql.= " ".$db->pdate("a.datep")." as dp,"; $sql.= " ".$db->pdate("a.datea")." as da,"; $sql.= " a.percent,"; $sql.= " c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, fk_contact, u.login, 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 '\n"; $oldyear = strftime("%Y",$obj->dp); } if ($oldmonth == strftime("%Y%b",$obj->dp) ) { print ''; } else { print '\n"; $oldmonth = strftime("%Y%b",$obj->dp); } print '\n"; print ''; // Picto warning print ''; // Status/Percent print ''; if ($obj->propalrowid) { print ''; } else { $actionstatic->code=$obj->acode; $actionstatic->libelle=$obj->libelle; $actionstatic->id=$obj->id; print ''; } print ''; // Contact pour cette action if ($obj->fk_contact > 0) { $contact = new Contact($db); $contact->fetch($obj->fk_contact); print ''; } else { print ''; } print ''; // Statut print ''; print "\n"; $i++; } } else { // Aucun action à faire } $db->free($result); } else { dolibarr_print_error($db); } print "
'.$langs->trans("ActionsToDoShort").' 
|'.strftime("%Y",$obj->dp)."|' .strftime("%b",$obj->dp)."'.strftime("%d",$obj->dp)."'.strftime("%H:%M",$obj->dp).''; if (date("U",$obj->dp) < time()) print ' '.img_warning("Late"); else print ' '; print ' '.img_object($langs->trans("ShowAction"),"task"); $transcode=$langs->trans("Action".$obj->acode); $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); print $libelle; print ''.$actionstatic->getNomUrl(1,16).''.$obj->label.''.$contact->getNomUrl(1).' '; $userstatic->id=$obj->fk_user_author; $userstatic->login=$obj->login; print $userstatic->getLoginUrl(1); print ''.$actionstatic->LibStatut($obj->percent,3).'
"; print "
"; /* * Listes des actions effectuees */ print ''; print ''; print ''; print ''; $sql = "SELECT a.id, a.label,"; $sql.= " ".$db->pdate("a.datep")." as dp,"; $sql.= " ".$db->pdate("a.datea")." as da,"; $sql.= " a.percent,"; $sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,"; $sql.= " c.code as acode, c.libelle,"; $sql.= " u.login, 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; $obj = $db->fetch_object($result); print ""; // Champ date if ($oldyear == strftime("%Y",$obj->da) ) { print ''; } else { print '\n"; $oldyear = strftime("%Y",$obj->da); } if ($oldmonth == strftime("%Y%b",$obj->da) ) { print ''; } else { print '\n"; $oldmonth = strftime("%Y%b",$obj->da); } print '\n"; print '\n"; // Picto print ''; // Espace print ''; // Action print ''; // Objet lié print ''; // Libellé print ""; // Contact pour cette action if ($obj->fk_contact > 0) { $contact = new Contact($db); $contact->fetch($obj->fk_contact); print ''; } else { print ''; } // Auteur print ''; // Statut print ''; print "\n"; $i++; } $db->free($result); } else { dolibarr_print_error($db); } print "
'.$langs->trans("ActionsDoneShort").'
|'.strftime("%Y",$obj->da)."|'.strftime("%b",$obj->da)."'.strftime("%d",$obj->da)."'.strftime("%H:%M",$obj->da)."  '; $actionstatic->code=$obj->acode; $actionstatic->libelle=$obj->libelle; $actionstatic->id=$obj->id; print $actionstatic->getNomUrl(1,16); print ''; if ($obj->propalrowid) { print ''.img_object($langs->trans("ShowPropal"),"propal"); print $langs->trans("Propal"); print ''; } if ($obj->fk_facture) { $facturestatic->ref=$langs->trans("Invoice"); $facturestatic->id=$obj->rowid; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,'compta'); } else print ' '; print '$obj->label'.$contact->getNomUrl(1).' '; $userstatic->id=$obj->rowid; $userstatic->login=$obj->login; print $userstatic->getLoginUrl(1); print ''.$actionstatic->LibStatut($obj->percent,3).'

"; } else { dolibarr_print_error($db,'Bad value for socid parameter'); } $db->close(); llxFooter('$Date$ - $Revision$'); ?>