diff --git a/ChangeLog b/ChangeLog index 4841827aabd6ea6910556eab344e1667f07de83a..33bcba2d4f4af1cfa8d67ab2fc7e134158e95424 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index e84d60b84891ad386db5cdfa679f1f0ad0852123..0a8e3e030bd622c6e8f4b9926663dbcf5db5dfd7 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -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; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index d0ae723dcda3d6ac9ea5fa2a95e65264306a11e2..393b31a685103baed013431c06e11340f2679599 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -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 diff --git a/htdocs/fichinter/fichinter.class.php b/htdocs/fichinter/fichinter.class.php index a6491f2a8c3f932a210ba3b504df3db469962de2..f80f77f6249f7e7ad2531fb2326c01f154f27459 100644 --- a/htdocs/fichinter/fichinter.class.php +++ b/htdocs/fichinter/fichinter.class.php @@ -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) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index b5bfab0f9394453d340496f7d9a06241a7f73578..7154d4b5d531862585c2a29627690619f2056c03 100755 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -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 diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 1fb719ce600c05325aa53ea9c45bc9e8f2d36f12..34e7303376c3bfb7c4e62625630cd54255f7c083 100755 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -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 diff --git a/htdocs/project.class.php b/htdocs/project.class.php index 7421749e84eb09d26444ebb3aac2a87377949413..c8084d0b329fe709404f08c44511c029269e6d3b 100644 --- a/htdocs/project.class.php +++ b/htdocs/project.class.php @@ -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) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 20d52e5d611be36f520b9d4c4062842bcd3a3df5..aae0eb5e4fbaae682c4bb54a0ee7999e6e2c2f7a 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -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 */ diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 3f1d410d35cbdd126b1aaf490d7148294efead73..c0cd6a57555766a65178526731ad6c7fbe84cfdd 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -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++; diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php index b49765cb61a0882997f152e25b791730fda0e45c..a651b1dee923fed5b9fd61a4e9fded53636b62c1 100644 --- a/htdocs/projet/liste.php +++ b/htdocs/projet/liste.php @@ -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++; diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 14a6d5c5b3b6eb89fad39383346091db259068f8..d6d72941101bb67ba3736b84c007abcb1e6c9b43 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -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) {