New: task #9802 : Can link an action to a project
This commit is contained in:
parent
6eaab9b909
commit
e5658c3ae6
@ -4,6 +4,7 @@ English Dolibarr ChangeLog
|
||||
***** ChangeLog for 2.8 compared to 2.7 *****
|
||||
|
||||
For users:
|
||||
- New: task #9802 : Can link an action to a project.
|
||||
- New: Initial sold can be conciliated.
|
||||
- New: task #9935: Can edit accountancy code.
|
||||
- New: Add a default errors-to email for emailing module.
|
||||
|
||||
@ -61,6 +61,8 @@ class ActionComm
|
||||
|
||||
var $societe; // Company linked to action (optionnal)
|
||||
var $contact; // Contact linked tot action (optionnal)
|
||||
var $fk_project; // Id of project (optionnal)
|
||||
|
||||
var $note;
|
||||
var $percentage;
|
||||
|
||||
@ -86,10 +88,10 @@ class ActionComm
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Ajout d'une action en base
|
||||
* \brief Add an action into database
|
||||
* \param user auteur de la creation de l'action
|
||||
* \param notrigger 1 ne declenche pas les triggers, 0 sinon
|
||||
* \return int id de l'action creee, < 0 si erreur
|
||||
* \return int id de l'action creee, < 0 if KO
|
||||
*/
|
||||
function add($user,$notrigger=0)
|
||||
{
|
||||
@ -108,6 +110,7 @@ class ActionComm
|
||||
if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date);
|
||||
if ($this->datep && $this->datef && $this->datep > $this->datef) $this->datef=$this->datep;
|
||||
if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date;
|
||||
if ($this->fk_project < 0) $this->fk_project = 0;
|
||||
|
||||
$now=time();
|
||||
if (! $this->type_id && $this->type_code)
|
||||
@ -146,6 +149,7 @@ class ActionComm
|
||||
$sql.= "durationa,";
|
||||
$sql.= "fk_action,";
|
||||
$sql.= "fk_soc,";
|
||||
$sql.= "fk_project,";
|
||||
$sql.= "note,";
|
||||
$sql.= "fk_contact,";
|
||||
$sql.= "fk_user_author,";
|
||||
@ -163,6 +167,7 @@ class ActionComm
|
||||
$sql.= ($this->durationa >= 0 && $this->durationa != ''?"'".$this->durationa."'":"null").",";
|
||||
$sql.= " '".$this->type_id."',";
|
||||
$sql.= ($this->societe->id>0?" '".$this->societe->id."'":"null").",";
|
||||
$sql.= ($this->fk_project>0?" '".$this->fk_project."'":"null").",";
|
||||
$sql.= " '".addslashes($this->note)."',";
|
||||
$sql.= ($this->contact->id > 0?"'".$this->contact->id."'":"null").",";
|
||||
$sql.= ($user->id > 0 ? "'".$user->id."'":"null").",";
|
||||
@ -218,6 +223,7 @@ class ActionComm
|
||||
$sql.= " a.tms as datem,";
|
||||
$sql.= " a.note, a.label, a.fk_action as type_id,";
|
||||
$sql.= " a.fk_soc,";
|
||||
$sql.= " a.fk_project,";
|
||||
$sql.= " a.fk_user_author, a.fk_user_mod,";
|
||||
$sql.= " a.fk_user_action, a.fk_user_done,";
|
||||
$sql.= " a.fk_contact, a.percent as percentage, a.fk_facture, a.fk_commande, a.propalrowid,";
|
||||
@ -267,6 +273,7 @@ class ActionComm
|
||||
|
||||
$this->societe->id = $obj->fk_soc;
|
||||
$this->contact->id = $obj->fk_contact;
|
||||
$this->fk_project = $obj->fk_project;
|
||||
|
||||
$this->fk_facture = $obj->fk_facture;
|
||||
if ($this->fk_facture)
|
||||
@ -339,6 +346,7 @@ class ActionComm
|
||||
if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date);
|
||||
if ($this->datep && $this->datef && $this->datep > $this->datef) $this->datef=$this->datep;
|
||||
if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date;
|
||||
if ($this->fk_project < 0) $this->fk_project = 0;
|
||||
|
||||
// Check parameters
|
||||
if ($this->percentage == 0 && $this->userdone->id > 0)
|
||||
@ -357,6 +365,7 @@ class ActionComm
|
||||
//$sql.= ", datea2 = ".(strval($this->dateend)!='' ? "'".$this->db->idate($this->dateend)."'" : 'null');
|
||||
$sql.= ", note = ".($this->note ? "'".addslashes($this->note)."'":"null");
|
||||
$sql.= ", fk_soc =". ($this->societe->id > 0 ? "'".$this->societe->id."'":"null");
|
||||
$sql.= ", fk_project =". ($this->fk_project > 0 ? "'".$this->fk_project."'":"null");
|
||||
$sql.= ", fk_contact =". ($this->contact->id > 0 ? "'".$this->contact->id."'":"null");
|
||||
$sql.= ", priority = '".$this->priority."'";
|
||||
$sql.= ", location = ".($this->location ? "'".addslashes($this->location)."'":"null");
|
||||
@ -534,7 +543,7 @@ class ActionComm
|
||||
* \return string Chaine avec URL
|
||||
* \remarks Utilise $this->id, $this->code et $this->libelle
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$maxlength,$class='',$option='')
|
||||
function getNomUrl($withpicto=0,$maxlength=0,$class='',$option='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
@ -33,6 +33,8 @@ require_once(DOL_DOCUMENT_ROOT."/user.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/cactioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formactions.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("commercial");
|
||||
@ -115,19 +117,7 @@ if ($_POST["action"] == 'add_action')
|
||||
$_POST["p2month"],
|
||||
$_POST["p2day"],
|
||||
$_POST["p2year"]);
|
||||
/*$datea=dol_mktime($_POST["adhour"], // deprecated
|
||||
$_POST["admin"],
|
||||
0,
|
||||
$_POST["admonth"],
|
||||
$_POST["adday"],
|
||||
$_POST["adyear"]);
|
||||
$datea2=dol_mktime($_POST["a2hour"], // deprecated
|
||||
$_POST["a2min"],
|
||||
0,
|
||||
$_POST["a2month"],
|
||||
$_POST["a2day"],
|
||||
$_POST["a2year"]);
|
||||
*/
|
||||
|
||||
|
||||
if (! $datep2 && $_POST["percentage"] == 100)
|
||||
{
|
||||
@ -169,6 +159,7 @@ if ($_POST["action"] == 'add_action')
|
||||
else $actioncomm->label = $cactioncomm->libelle;
|
||||
}
|
||||
}
|
||||
$actioncomm->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
|
||||
$actioncomm->datep = $datep;
|
||||
//$actioncomm->date = $datea;
|
||||
$actioncomm->datef = $datep2;
|
||||
@ -370,7 +361,9 @@ if ($_POST["action"] == 'update')
|
||||
$actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
|
||||
$actioncomm->societe->id = $_POST["socid"];
|
||||
$actioncomm->contact->id = $_POST["contactid"];
|
||||
$actioncomm->fk_project = $_POST["projectid"];
|
||||
$actioncomm->note = $_POST["note"];
|
||||
$actioncomm->pnote = $_POST["note"];
|
||||
|
||||
if (! $datep2 && $_POST["percentage"] == 100)
|
||||
{
|
||||
@ -511,6 +504,21 @@ if ($_GET["action"] == 'create')
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Project
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
// Projet associe
|
||||
$langs->load("project");
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';
|
||||
$numprojet=select_projects($societe->id,$projetid,'projectid');
|
||||
if ($numprojet==0)
|
||||
{
|
||||
print ' <a href="../../projet/fiche.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
print '<table class="border" width="100%">';
|
||||
@ -536,7 +544,7 @@ if ($_GET["action"] == 'create')
|
||||
}
|
||||
|
||||
// Date start
|
||||
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("DateActionStart").'</td><td>';
|
||||
print '<tr><td width="30%" nowrap="nowrap"><b>'.$langs->trans("DateActionStart").'*</b></td><td>';
|
||||
if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->datep,'ap',1,1,0,"action",1,1);
|
||||
else if ($_REQUEST["afaire"] == 2) $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1);
|
||||
else $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1);
|
||||
@ -684,6 +692,21 @@ if ($_GET["id"])
|
||||
$html->select_array("contactid", $act->societe->contact_array(), $act->contact->id, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
// Projet associe
|
||||
$langs->load("project");
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
$numprojet=select_projects($act->societe->id,$act->fk_project,'projectid');
|
||||
if ($numprojet==0)
|
||||
{
|
||||
print ' <a href="../../projet/fiche.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table><br><table class="border" width="100%">';
|
||||
|
||||
// Input by
|
||||
@ -803,6 +826,19 @@ if ($_GET["id"])
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
if ($act->fk_project)
|
||||
{
|
||||
$project=new Project($db);
|
||||
$project->fetch($act->fk_project);
|
||||
print $project->getNomUrl(1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table><br><table class="border" width="100%">';
|
||||
|
||||
// Input by
|
||||
|
||||
@ -322,7 +322,8 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* \brief Retourne le libelle du statut
|
||||
* \return string Libelle
|
||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* \return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
@ -332,6 +333,7 @@ class Fichinter extends CommonObject
|
||||
/**
|
||||
* \brief Renvoi le libelle d'un statut donne
|
||||
* \param statut id statut
|
||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* \return string Libelle
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
|
||||
@ -45,6 +45,7 @@ ListPredefinedInvoicesAssociatedProject=List of customers' predefined invoices a
|
||||
ListSupplierOrdersAssociatedProject=List of suppliers' orders associated with the project
|
||||
ListSupplierInvoicesAssociatedProject=List of suppliers' invoices associated with the project
|
||||
ListContractAssociatedProject=List of contracts associated with the project
|
||||
ListActionsAssociatedProject=List of actions associated with the project
|
||||
ActivityOnProjectThisWeek=Activity on project this week
|
||||
ActivityOnProjectThisMonth=Activity on project this month
|
||||
ActivityOnProjectThisYear=Activity on project this year
|
||||
|
||||
@ -45,6 +45,7 @@ ListPredefinedInvoicesAssociatedProject=Liste des factures clients prédéfinies
|
||||
ListSupplierOrdersAssociatedProject=Liste des commandes fournisseurs associées au projet
|
||||
ListSupplierInvoicesAssociatedProject=Liste des factures fournisseur associées au projet
|
||||
ListContractAssociatedProject=Liste des contrats associés au projet
|
||||
ListActionsAssociatedProject=Liste des actions associées au projet
|
||||
ActivityOnProjectThisWeek=Activité sur les projets cette semaine
|
||||
ActivityOnProjectThisMonth=Activité sur les projets ce mois
|
||||
ActivityOnProjectThisYear=Activité sur les projets cette année
|
||||
|
||||
@ -258,13 +258,14 @@ class Project extends CommonObject
|
||||
$elements = array();
|
||||
|
||||
$sql='';
|
||||
if ($type == 'propal') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."propal WHERE fk_projet=".$this->id;
|
||||
if ($type == 'order') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande WHERE fk_projet=".$this->id;
|
||||
if ($type == 'invoice') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE fk_projet=".$this->id;
|
||||
if ($type == 'propal') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."propal WHERE fk_projet=".$this->id;
|
||||
if ($type == 'order') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande WHERE fk_projet=".$this->id;
|
||||
if ($type == 'invoice') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE fk_projet=".$this->id;
|
||||
if ($type == 'invoice_predefined') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture_rec WHERE fk_projet=".$this->id;
|
||||
if ($type == 'order_supplier') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE fk_projet=".$this->id;
|
||||
if ($type == 'invoice_supplier') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture_fourn WHERE fk_projet=".$this->id;
|
||||
if ($type == 'contract') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."contrat WHERE fk_projet=".$this->id;
|
||||
if ($type == 'order_supplier') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE fk_projet=".$this->id;
|
||||
if ($type == 'invoice_supplier') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture_fourn WHERE fk_projet=".$this->id;
|
||||
if ($type == 'contract') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."contrat WHERE fk_projet=".$this->id;
|
||||
if ($type == 'agenda') $sql = "SELECT id as rowid FROM ".MAIN_DB_PREFIX."actioncomm WHERE fk_project=".$this->id;
|
||||
if (! $sql) return -1;
|
||||
|
||||
dol_syslog("Project::get_element_list sql=".$sql);
|
||||
@ -681,7 +682,8 @@ class Project extends CommonObject
|
||||
|
||||
/**
|
||||
* \brief Return status label of object
|
||||
* \return string Label
|
||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* \return string Label
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
@ -691,7 +693,8 @@ class Project extends CommonObject
|
||||
/**
|
||||
* \brief Renvoi status label for a status
|
||||
* \param statut id statut
|
||||
* \return string Label
|
||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* \return string Label
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
@ -715,12 +718,12 @@ class Project extends CommonObject
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
|
||||
@ -33,6 +33,7 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/comma
|
||||
if ($conf->fournisseur->enabled) require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php");
|
||||
if ($conf->fournisseur->enabled) require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.commande.class.php");
|
||||
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
|
||||
if ($conf->agenda->enabled) require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
|
||||
$langs->load("projects");
|
||||
@ -133,8 +134,12 @@ $listofreferent=array(
|
||||
'contract'=>array(
|
||||
'title'=>"ListContractAssociatedProject",
|
||||
'class'=>'Contrat',
|
||||
'test'=>$conf->contrat->enabled)
|
||||
|
||||
'test'=>$conf->contrat->enabled),
|
||||
'agenda'=>array(
|
||||
'title'=>"ListActionsAssociatedProject",
|
||||
'class'=>'ActionComm',
|
||||
'disableamount'=>1,
|
||||
'test'=>$conf->agenda->enabled)
|
||||
);
|
||||
|
||||
foreach ($listofreferent as $key => $value)
|
||||
@ -152,7 +157,7 @@ foreach ($listofreferent as $key => $value)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="150">'.$langs->trans("Ref").'</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
if (empty($value['disableamount'])) print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td align="right" width="200">'.$langs->trans("Status").'</td>';
|
||||
print '</tr>';
|
||||
$elementarray = $projet->get_element_list($key);
|
||||
@ -167,27 +172,37 @@ foreach ($listofreferent as $key => $value)
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
// Ref
|
||||
print "<td>";
|
||||
print $element->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
// Date
|
||||
$date=$element->date;
|
||||
if (empty($date)) $date=$element->datep;
|
||||
if (empty($date)) $date=$element->date_contrat;
|
||||
print '<td>'.dol_print_date($date,'day').'</td>';
|
||||
print '<td align="right">'.(isset($element->total_ht)?price($element->total_ht):' ').'</td>';
|
||||
|
||||
// Amount
|
||||
if (empty($value['disableamount'])) print '<td align="right">'.(isset($element->total_ht)?price($element->total_ht):' ').'</td>';
|
||||
|
||||
// Status
|
||||
print '<td align="right">'.$element->getLibStatut(5).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$total = $total + $element->total_ht;
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Number").': '.$i.'</td>';
|
||||
print '<td align="right" width="100">'.$langs->trans("TotalHT").' : '.price($total).'</td>';
|
||||
if (empty($value['disableamount'])) print '<td align="right" width="100">'.$langs->trans("TotalHT").' : '.price($total).'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'action
|
||||
*/
|
||||
|
||||
@ -42,6 +42,7 @@ if ($user->societe_id > 0)
|
||||
*/
|
||||
|
||||
$company=new Societe($db);
|
||||
$projectstatic=new Project($db);
|
||||
|
||||
llxHeader("",$langs->trans("Projects"),"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
|
||||
|
||||
@ -56,9 +57,10 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Project"),"index.php","","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("NbOpenTasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, count(t.rowid)";
|
||||
$sql = "SELECT p.title, p.rowid, p.fk_statut, count(t.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
@ -77,11 +79,13 @@ if ( $resql )
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row( $resql);
|
||||
$row = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$row[1].'">'.img_object($langs->trans("ShowProject"),"project")." ".$row[0].'</a></td>';
|
||||
print '<td align="right">'.$row[2].'</td>';
|
||||
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$row->rowid.'">'.img_object($langs->trans("ShowProject"),"project")." ".$row->title.'</a></td>';
|
||||
print '<td align="right">'.$row->nb.'</td>';
|
||||
$projectstatic->statut=$row->fk_statut;
|
||||
print '<td align="right">'.$projectstatic->getLibStatut(3).'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
/**
|
||||
* \file htdocs/projet/liste.php
|
||||
* \ingroup projet
|
||||
* \brief Page liste des projets
|
||||
* \brief Page to list projects
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
@ -69,7 +69,7 @@ $projectstatic = new Project($db);
|
||||
$userstatic = new User($db);
|
||||
$staticsoc=new Societe($db);
|
||||
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, ".$db->pdate("p.dateo")." as do, p.fk_user_resp,";
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_statut, ".$db->pdate("p.dateo")." as do, p.fk_user_resp,";
|
||||
$sql.= " u.login,";
|
||||
$sql.= " s.nom, s.rowid as socid, s.client";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
@ -108,11 +108,11 @@ if ($resql)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),"liste.php","p.ref","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),"liste.php","p.title","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("OfficerProject"),"liste.php","","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("OfficerProject"),$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"","",'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<form method="get" action="liste.php">';
|
||||
@ -169,7 +169,10 @@ if ($resql)
|
||||
else print $langs->trans("SharedProject");
|
||||
print '</td>';
|
||||
|
||||
print '<td> </td>';
|
||||
// Status
|
||||
$projectstatic->statut=$objp->fk_statut;
|
||||
print '<td align="right">'.$projectstatic->getLibStatut(3).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
|
||||
@ -732,7 +732,7 @@ class Propal extends CommonObject
|
||||
$this->error='ErrorSetupNotComplete';
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php");
|
||||
$obj = $conf->global->PROPALE_ADDON;
|
||||
$modPropale = new $obj;
|
||||
@ -1403,7 +1403,7 @@ class Propal extends CommonObject
|
||||
$sql.= " WHERE fk_source = ".$this->id;
|
||||
$sql.= " AND sourcetype = '".$this->element."'";
|
||||
$sql.= " AND targettype = 'commande'";
|
||||
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$nump = $this->db->num_rows();
|
||||
@ -1439,7 +1439,7 @@ class Propal extends CommonObject
|
||||
$this->commandes = array();
|
||||
|
||||
$ga = array();
|
||||
|
||||
|
||||
$sql = "SELECT fk_target FROM ".MAIN_DB_PREFIX."element_element";
|
||||
$sql.= " WHERE fk_source = " . $this->id;
|
||||
$sql.= " AND sourcetype = '".$this->element."'";
|
||||
@ -1494,7 +1494,7 @@ class Propal extends CommonObject
|
||||
{
|
||||
$ga = array();
|
||||
$linkedInvoices = array();
|
||||
|
||||
|
||||
$this->load_object_linked($id,$this->element);
|
||||
foreach($this->linked_object as $key => $object)
|
||||
{
|
||||
@ -1513,7 +1513,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$sql= "SELECT rowid as facid, facnumber, total,".$this->db->pdate("datef")." as df, fk_user_author, fk_statut, paye";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE rowid IN (".implode(',',$linkedInvoices).")";
|
||||
@ -1542,7 +1542,7 @@ class Propal extends CommonObject
|
||||
$obj = array_shift($tab_sqlobj);
|
||||
|
||||
$ga[$i] = $obj;
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -1742,9 +1742,9 @@ class Propal extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne le libelle du statut d'une propale (brouillon, validee, ...)
|
||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* \return string Libelle
|
||||
* \brief Return label of status of proposal (draft, validated, ...)
|
||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* \return string Label
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
@ -1752,10 +1752,10 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libelle d'un statut donne
|
||||
* \brief Return label of a status (draft, validated, ...)
|
||||
* \param statut id statut
|
||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* \return string Libelle
|
||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* \return string Label
|
||||
*/
|
||||
function LibStatut($statut,$mode=1)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user