Fix: uniformisation du code
This commit is contained in:
parent
d5fff0337e
commit
964d282b4a
@ -33,7 +33,7 @@ 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->facture->enabled) 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");
|
||||
@ -847,9 +847,9 @@ if ($socid > 0)
|
||||
$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.= " sp.name, sp.firstname";
|
||||
$sql.= " sp.name, sp.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
$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";
|
||||
@ -928,7 +928,7 @@ if ($socid > 0)
|
||||
print '</td>';
|
||||
|
||||
// Libellé
|
||||
print "<td>$obj->label</td>";
|
||||
print '<td>'.$obj->label.'</td>';
|
||||
|
||||
// Contact pour cette action
|
||||
if ($obj->fk_contact > 0)
|
||||
@ -951,7 +951,7 @@ if ($socid > 0)
|
||||
print '</td>';
|
||||
|
||||
// Statut
|
||||
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
|
||||
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
|
||||
@ -32,7 +32,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/prospect.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
||||
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
||||
|
||||
$langs->load('companies');
|
||||
$langs->load('projects');
|
||||
@ -90,6 +90,7 @@ llxHeader();
|
||||
|
||||
if ($socid > 0)
|
||||
{
|
||||
$actionstatic=new ActionComm($db);
|
||||
$societe = new Prospect($db, $socid);
|
||||
$result = $societe->fetch($socid);
|
||||
if ($result < 0)
|
||||
@ -316,7 +317,8 @@ if ($socid > 0)
|
||||
*
|
||||
*/
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre"><td colspan="9"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'">'.$langs->trans("ActionsToDo").'</a></td><td align="right"> </td></tr>';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="10"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'">'.$langs->trans("ActionsToDo").'</a></td><td align="right"> </td></tr>';
|
||||
|
||||
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code as acode, c.libelle, u.login, 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 ";
|
||||
@ -383,13 +385,12 @@ if ($socid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowAction"),"task");
|
||||
$transcode=$langs->trans("Action".$obj->acode);
|
||||
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
|
||||
print $libelle;
|
||||
print '</a></td>';
|
||||
$actionstatic->code=$obj->acode;
|
||||
$actionstatic->libelle=$obj->libelle;
|
||||
$actionstatic->id=$obj->id;
|
||||
print '<td>'.$actionstatic->getNomUrl(1,16).'</td>';
|
||||
}
|
||||
print "<td>$obj->label</td>";
|
||||
print '<td>'.$obj->label.'</td>';
|
||||
|
||||
// Contact pour cette action
|
||||
if ($obj->fk_contact) {
|
||||
@ -401,6 +402,10 @@ if ($socid > 0)
|
||||
}
|
||||
|
||||
print '<td width="80" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a></td>';
|
||||
|
||||
// Statut
|
||||
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -415,9 +420,14 @@ if ($socid > 0)
|
||||
* Listes des actions effectuées
|
||||
*/
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre"><td colspan="9"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'">'.$langs->trans("ActionsDone").'</a></td></tr>';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'">'.$langs->trans("ActionsDone").'</a></td></tr>';
|
||||
|
||||
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, fk_contact, u.login, u.rowid ";
|
||||
$sql = "SELECT a.id, a.label,";
|
||||
$sql.= " ".$db->pdate("a.datea")." as da,";
|
||||
$sql.= " a.propalrowid, a.fk_user_author, a.fk_contact, a.percent,";
|
||||
$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 = ".$societe->id;
|
||||
$sql .= " AND u.rowid = a.fk_user_author";
|
||||
@ -459,12 +469,11 @@ if ($socid > 0)
|
||||
print '<td> </td>';
|
||||
|
||||
// Action
|
||||
print '<td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowTask"),"task");
|
||||
$transcode=$langs->trans("Action".$obj->acode);
|
||||
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
|
||||
print $libelle;
|
||||
print '</a>';
|
||||
print '<td>';
|
||||
$actionstatic->code=$obj->acode;
|
||||
$actionstatic->libelle=$obj->libelle;
|
||||
$actionstatic->id=$obj->id;
|
||||
print '<td>'.$actionstatic->getNomUrl(1,16).'</td>';
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
@ -476,6 +485,9 @@ if ($socid > 0)
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
// Libellé
|
||||
print '<td>'.$obj->label.'</td>';
|
||||
|
||||
// Contact pour cette action
|
||||
if ($obj->fk_contact)
|
||||
@ -489,11 +501,15 @@ if ($socid > 0)
|
||||
print '<td> </td>';
|
||||
}
|
||||
|
||||
print '<width="80" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
|
||||
print '<td width="80" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
|
||||
|
||||
// Statut
|
||||
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
require('./pre.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
|
||||
|
||||
$user->getrights();
|
||||
|
||||
@ -74,6 +75,8 @@ if (!$user->rights->commercial->client->voir && $socid && !$user->societe_id > 0
|
||||
* Mode fiche
|
||||
*/
|
||||
$societe = new Fournisseur($db);
|
||||
$actionstatic = new ActionComm($db);
|
||||
$contactstatic = new Contact($db);
|
||||
|
||||
if ( $societe->fetch($socid) )
|
||||
{
|
||||
@ -367,14 +370,17 @@ if ( $societe->fetch($socid) )
|
||||
*/
|
||||
print_titre($langs->trans("ActionsOnCompany"));
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre"><td colspan="10"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&status=todo">'.$langs->trans("ActionsToDoShort").'</a></td><td align="right"> </td></tr>';
|
||||
print '<tr class="liste_titre"><td colspan="11"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&status=todo">'.$langs->trans("ActionsToDoShort").'</a></td><td align="right"> </td></tr>';
|
||||
|
||||
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code as acode, c.libelle, u.login, 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.datep DESC, a.id DESC";
|
||||
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code as acode, c.libelle, u.login,";
|
||||
$sql.= " a.propalrowid, a.fk_user_author, a.fk_contact, u.rowid,";
|
||||
$sql.= " sp.name, sp.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
$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.datep DESC, a.id DESC";
|
||||
|
||||
$result=$db->query($sql);
|
||||
if ($result)
|
||||
@ -442,17 +448,24 @@ if ( $societe->fetch($socid) )
|
||||
print '<td colspan="2">'.$obj->label.'</td>';
|
||||
|
||||
// Contact pour cette action
|
||||
if ($obj->fk_contact)
|
||||
{
|
||||
$contact = new Contact($db);
|
||||
$contact->fetch($obj->fk_contact);
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->fk_contact.'">'.img_object($langs->trans("ShowContact"),"contact").' '.$contact->getFullName($langs).'</a></td>';
|
||||
} else {
|
||||
print '<td> </td>';
|
||||
}
|
||||
if ($obj->fk_contact > 0)
|
||||
{
|
||||
$contactstatic->name=$obj->name;
|
||||
$contactstatic->firstname=$obj->firstname;
|
||||
$contactstatic->id=$obj->fk_contact;
|
||||
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td> </td>';
|
||||
}
|
||||
|
||||
// Auteur
|
||||
print '<td width="80" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a></td>';
|
||||
|
||||
// Statut
|
||||
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -467,13 +480,16 @@ if ( $societe->fetch($socid) )
|
||||
* Listes des actions effectuées
|
||||
*/
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre"><td colspan="11"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&status=done">'.$langs->trans("ActionsDoneShort").'</a></td></tr>';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&status=done">'.$langs->trans("ActionsDoneShort").'</a></td></tr>';
|
||||
|
||||
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da,";
|
||||
$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.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.= " u.login, u.rowid,";
|
||||
$sql.= " sp.name, sp.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
$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";
|
||||
@ -527,7 +543,7 @@ if ( $societe->fetch($socid) )
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
// Objet li
|
||||
// Objet lie
|
||||
print '<td>';
|
||||
if ($obj->propalrowid)
|
||||
{
|
||||
@ -544,23 +560,28 @@ if ( $societe->fetch($socid) )
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
// Libell
|
||||
// Libelle
|
||||
print "<td>$obj->label</td>";
|
||||
|
||||
// Contact pour cette action
|
||||
if ($obj->fk_contact)
|
||||
{
|
||||
$contact = new Contact($db);
|
||||
$contact->fetch($obj->fk_contact);
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$contact->id.'">'.img_object($langs->trans("ShowContact"),"contact").' '.$contact->getFullName($langs).'</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td> </td>';
|
||||
}
|
||||
if ($obj->fk_contact > 0)
|
||||
{
|
||||
$contactstatic->name=$obj->name;
|
||||
$contactstatic->firstname=$obj->firstname;
|
||||
$contactstatic->id=$obj->fk_contact;
|
||||
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td> </td>';
|
||||
}
|
||||
|
||||
// Auteur
|
||||
print '<td width="80" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
|
||||
|
||||
// Statut
|
||||
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user