From b62a24549d57c30e4be3262ac7d1bc0e2457ed56 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Aug 2006 01:08:03 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Lien=20bouton=20cr=E9er=20action=20incor?= =?UTF-8?q?rect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/fiche.php | 565 +++++++++++++++++++-------------------- htdocs/compta/fiche.php | 567 +++++++++++++++++++--------------------- 2 files changed, 549 insertions(+), 583 deletions(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 0fc7305c9db..adc138bb539 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -628,7 +628,7 @@ if ($socidp > 0) if ($conf->propal->enabled && $user->rights->propale->creer) { $langs->load("propal"); - print ''.$langs->trans("AddProp").''; + print ''.$langs->trans("AddProp").''; } if ($conf->commande->enabled && $user->rights->commande->creer) @@ -646,10 +646,10 @@ if ($socidp > 0) if ($conf->fichinter->enabled && $user->rights->ficheinter->creer) { $langs->load("fichinter"); - print ''.$langs->trans("AddIntervention").''; + print ''.$langs->trans("AddIntervention").''; } - print ''.$langs->trans("AddAction").''; + print ''.$langs->trans("AddAction").''; if ($user->rights->societe->contact->creer) { @@ -659,245 +659,113 @@ if ($socidp > 0) print ''; print '
'; - if ($action == 'changevalue') + /* + * + * Liste des contacts + * + */ + if ($conf->clicktodial->enabled) { - print "
"; - print "
id\" method=\"post\">"; - print ""; - print "Cette société est un cabinet de recrutement : "; - print ""; - print "trans("Valid")."\">"; - print "
\n"; + $user->fetch_clicktodial(); // lecture des infos de clicktodial } - else + + 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) { - /* - * - * Liste des contacts - * - */ - if ($conf->clicktodial->enabled) + $obj = $db->fetch_object($result); + $var = !$var; + print ""; + + print ''; + print ''; + print '
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'  
'; + 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 '
'.$obj->poste.' '; - print_titre($langs->trans("ContactsForCompany")); - print ''; + // Lien click to dial + if (strlen($obj->phone) && $user->clicktodial_enabled == 1) + { + print ''; + print img_phone_out("Appel émis") ; + } + print ''; + print ''; + print ''; - 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"; + print ''; - $result = $db->query($sql); - $i = 0; + print "\n"; + $i++; + } + print "
'; + print ''.dolibarr_print_phone($obj->phone).' '.dolibarr_print_phone($obj->fax).' '.$obj->email.' 
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'  
'; + print "idp\">"; + print img_edit(); + print ''; + print img_object($langs->trans("Rendez-Vous"),"action"); + print '
"; + + print "
"; + + + $actionstatic=new ActionComm($db); + + /* + * Listes des actions a faire + * + */ + print_titre($langs->trans("ActionsOnCompany")); + + print ''; + print ''; + print ''; + 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 ''; - print ''; - print ''; - - print ''; - - print ''; - - print "\n"; - $i++; - } - print "
'.$langs->trans("ActionsToDoShort").' 
'; - print ''; - print img_object($langs->trans("Show"),"contact"); - print ' '.$obj->firstname.' '. $obj->name.' '; - - 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 "
"; - - - $actionstatic=new ActionComm($db); - - /* - * Listes des actions a faire - * - */ - print_titre($langs->trans("ActionsOnCompany")); - - print ''; - print ''; - print ''; - 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 '\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 - { - print ''; - } - print ''; - - // Contact pour cette action - if ($obj->fk_contact) { - $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 ''.img_object($langs->trans("ShowAction"),"task"); - $transcode=$langs->trans("Action".$obj->acode); - $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); - print $libelle; - print ''.$obj->label.''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' '.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.''.$actionstatic->LibStatut($obj->percent,3).'
"; - - print "
"; - - - /* - * Listes des actions effectuees - */ - print ''; - print ''; - print ''; - 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 '\n"; - $oldyear = strftime("%Y",$obj->da); + print '\n"; + $oldyear = strftime("%Y",$obj->dp); } - if ($oldmonth == strftime("%Y%b",$obj->da) ) + if ($oldmonth == strftime("%Y%b",$obj->dp) ) { print ''; } else { - print '\n"; - $oldmonth = strftime("%Y%b",$obj->da); + print '\n"; + $oldmonth = strftime("%Y%b",$obj->dp); } - print '\n"; - print '\n"; - // Picto - print ''; - - // Espace - print ''; - - // Action - print '\n"; + print ''; + + // Picto warning + print ''; - // Objet lié - print ''; + // Status/Percent + print ''; - // Libellé - print ""; + if ($obj->propalrowid) + { + print ''; + } + else + { + print ''; + } + print ''; // Contact pour cette action - if ($obj->fk_contact) - { + if ($obj->fk_contact) { $contact = new Contact($db); $contact->fetch($obj->fk_contact); print ''; - } - else - { + } else { print ''; } - // Auteur - print ''; + print ''; // Statut print ''; - + print "\n"; $i++; } - - $db->free($result); - } - else - { - dolibarr_print_error($db); - } - print "
'.$langs->trans("ActionsDoneShort").'
|'.strftime("%Y",$obj->da)."'.strftime("%Y",$obj->dp)."|'.strftime("%b",$obj->da)."' .strftime("%b",$obj->dp)."'.strftime("%d",$obj->da)."'.strftime("%H:%M",$obj->da)."  '; - 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)."'.strftime("%H:%M",$obj->dp).''; + if (date("U",$obj->dp) < time()) print ' '.img_warning("Late"); + else print ' '; 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 ' $obj->label'.img_object($langs->trans("ShowAction"),"task"); + $transcode=$langs->trans("Action".$obj->acode); + $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); + print $libelle; + print ''.img_object($langs->trans("ShowAction"),"task"); + $transcode=$langs->trans("Action".$obj->acode); + $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); + print $libelle; + print ''.$obj->label.''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' '.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.''.$actionstatic->LibStatut($obj->percent,3).'
"; - + } + else + { + // Aucun action à faire + + } + $db->free($result); } -} else { - dolibarr_print_error($db); + else + { + dolibarr_print_error($db); + } + print "
"; + + print "
"; + + + /* + * Listes des actions effectuees + */ + print ''; + print ''; + print ''; + 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; + + $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) + { + $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)."  '; + 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 ''; + 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 '$obj->label'.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' '.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.$actionstatic->LibStatut($obj->percent,3).'
"; +} +else +{ + dolibarr_print_error($db,'Bad value for socid parameter'); } $db->close(); diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index 352f746a2ed..2502a3d4b74 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -346,16 +346,16 @@ if ($socid > 0) // Si société cliente ou prospect, on affiche bouton "Créer facture client" if ($societe->client != 0 && $conf->facture->enabled && $user->rights->facture->creer) { $langs->load("bills"); - print "id\">".$langs->trans("AddBill").""; + print "id\">".$langs->trans("AddBill").""; } if ($conf->deplacement->enabled) { $langs->load("trips"); - print "id&action=create\">".$langs->trans("AddTrip").""; + print "id&action=create\">".$langs->trans("AddTrip").""; } } - print ''.$langs->trans("AddAction").''; + print ''.$langs->trans("AddAction").''; if ($user->rights->societe->contact->creer) { @@ -367,321 +367,300 @@ if ($socid > 0) /* * + * Liste des contacts * */ - if ($action == 'changevalue') + 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 = ".$societe->id; + $sql.= " ORDER by p.datec"; + + $result = $db->query($sql); + $i = 0 ; $num = $db->num_rows($result); + $var=1; + while ($i < $num) { + $obj = $db->fetch_object($result); + $var = !$var; - print "
"; - print "id\" method=\"post\">"; - print ""; - print "Cette société est un cabinet de recrutement : "; - print ""; - print "trans("Update")."\">"; - print "\n"; + print ""; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + + print ''; + + print "\n"; + $i++; + $tag = !$tag; } - else + print "
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'  
'; + print ''.img_object($langs->trans("ShowContact"),"contact").' '.$obj->firstname.' '. $obj->name.' '; + + if (trim($obj->note)) + { + print '
'.nl2br(trim($obj->note)); + } + print '
'.$obj->poste.' '.$obj->phone.' '.$obj->fax.' '.$obj->email.' '; + + if ($user->rights->societe->contact->creer) + { + print "idp\">"; + print img_edit(); + print ''; + } + else print ' '; + + print ''; + print img_object($langs->trans("Rendez-Vous"),"action"); + print '
"; + + print "
"; + + + $actionstatic=new ActionComm($db); + + /* + * Listes des actions a faire + * + */ + print_titre($langs->trans("ActionsOnCompany")); + print ''; + print ''; + print ''; + print ''; + + $sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, 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 = ".$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) { - /* - * - * Liste des contacts - * - */ - print_titre($langs->trans("ContactsForCompany")); - print '
'.$langs->trans("ActionsToDoShort").' 
'; - - 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 = ".$societe->id; - $sql.= " ORDER by p.datec"; - - $result = $db->query($sql); - $i = 0 ; $num = $db->num_rows($result); - $var=1; + $i = 0 ; + $num = $db->num_rows($result); + $var=true; + while ($i < $num) { - $obj = $db->fetch_object($result); $var = !$var; + $obj = $db->fetch_object($result); print ""; - print ''; + } + else + { + print '\n"; + $oldyear = strftime("%Y",$obj->da); } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + if ($oldmonth == strftime("%Y%b",$obj->da) ) + { + print ''; + } + else + { + print '\n"; + $oldmonth = strftime("%Y%b",$obj->da); + } - print ''; + print '\n"; + print ''; + + // Picto warning + print ''; + + // Status/Percent + print ''; + + if ($obj->propalrowid) + { + print ''; + } + else + { + print ''; + } + + print ''; + + // Contact pour cette action + if ($obj->fk_contact) { + $contact = new Contact($db); + $contact->fetch($obj->fk_contact); + print ''; + } else { + print ''; + } + + // Auteur + print ''; + + // Statut + print ''; print "\n"; $i++; - $tag = !$tag; } - print "
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'  
'; - print ''.img_object($langs->trans("ShowContact"),"contact").' '.$obj->firstname.' '. $obj->name.' '; - - if (trim($obj->note)) + if ($oldyear == strftime("%Y",$obj->da) ) { - print '
'.nl2br(trim($obj->note)); + print '
|'.strftime("%Y",$obj->da)."'.$obj->poste.' '.$obj->phone.' '.$obj->fax.' '.$obj->email.' '; - - if ($user->rights->societe->contact->creer) - { - print "idp\">"; - print img_edit(); - print ''; - } - else print ' '; - - print '|' .strftime("%b",$obj->da)."'; - print img_object($langs->trans("Rendez-Vous"),"action"); - print ''.strftime("%d",$obj->da)."'.strftime("%H:%M",$obj->da).''; + if (date("U",$obj->da) < 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 ''.img_object($langs->trans("ShowAction"),"task"); + $transcode=$langs->trans("Action".$obj->acode); + $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); + print $libelle; + print ''.$obj->label.''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' '.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.''.$actionstatic->LibStatut($obj->percent,3).'
"; - - print "
"; - - - $actionstatic=new ActionComm($db); - - /* - * Listes des actions a faire - * - */ - print_titre($langs->trans("ActionsOnCompany")); - print ''; - print ''; - print ''; - print ''; - - $sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, 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 = ".$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 ''; - } - 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 ''; - - // Picto warning - print ''; - - // Status/Percent - print ''; - - if ($obj->propalrowid) - { - print ''; - } - else - { - print ''; - } - - print ''; - - // Contact pour cette action - if ($obj->fk_contact) { - $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("ActionsToDoShort").' 
|'.strftime("%Y",$obj->da)."|' .strftime("%b",$obj->da)."'.strftime("%d",$obj->da)."'.strftime("%H:%M",$obj->da).''; - if (date("U",$obj->da) < 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 ''.img_object($langs->trans("ShowAction"),"task"); - $transcode=$langs->trans("Action".$obj->acode); - $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); - print $libelle; - print ''.$obj->label.''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' '.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.''.$actionstatic->LibStatut($obj->percent,3).'

"; - - /* - * Listes des actions effectuées - */ - print ''; - print ''; - 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 = ".$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 ''; - } 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) - { - $contact = new Contact($db); - $contact->fetch($obj->fk_contact); - print ''; - } - else - { - print ''; - } - - // Auteur - print ''; - - // Statut - print ''; - - print "\n"; - $i++; - } - $db->free(); - } - else - { - dolibarr_print_error($db); - } - print "
'.$langs->trans("ActionsDoneShort").''; - print '
|'.strftime("%Y",$obj->da)."|'.strftime("%b",$obj->da)."'.strftime("%d",$obj->da)."'.strftime("%H:%M",$obj->da)."  '; - 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 ''; - 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 '$obj->label'.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' '.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.$actionstatic->LibStatut($obj->percent,3).'
"; + $db->free($result); } + else + { + dolibarr_print_error($db); + } + print "
"; -} else { - print "Erreur"; + /* + * Listes des actions effectuées + */ + print ''; + print ''; + 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 = ".$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 ''; + } 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) + { + $contact = new Contact($db); + $contact->fetch($obj->fk_contact); + print ''; + } + else + { + print ''; + } + + // Auteur + print ''; + + // Statut + print ''; + + print "\n"; + $i++; + } + $db->free(); + } + else + { + dolibarr_print_error($db); + } + print "
'.$langs->trans("ActionsDoneShort").''; + print '
|'.strftime("%Y",$obj->da)."|'.strftime("%b",$obj->da)."'.strftime("%d",$obj->da)."'.strftime("%H:%M",$obj->da)."  '; + 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 ''; + 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 '$obj->label'.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' '.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.$actionstatic->LibStatut($obj->percent,3).'
"; +} +else +{ + dolibarr_print_error($db,'Bad value for socid parameter'); } $db->close();