Fix link element from project "associates object" pages

http://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/50687-objet-associes-au-projet
This commit is contained in:
Florian HENRY
2014-06-13 15:54:37 +02:00
parent aecede08c4
commit 0916d2cf3b
3 changed files with 13 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ Fix: Filter on status was not visible when selected from url.
Fix: Filtering on status was last when asking to sort. Fix: Filtering on status was last when asking to sort.
Fix: [ bug #1454 ] Mention de bas de page erroné Fix: [ bug #1454 ] Mention de bas de page erroné
Fix: Do not display dictionnay for non activated module Fix: Do not display dictionnay for non activated module
Fix: Link element from element project pages
***** ChangeLog for 3.5.3 compared to 3.5.2 ***** ***** ChangeLog for 3.5.3 compared to 3.5.2 *****
Fix: Error on field accountancy code for export profile of invoices. Fix: Error on field accountancy code for export profile of invoices.

View File

@@ -168,6 +168,7 @@ class FormProjets
*/ */
function select_element($table_element) function select_element($table_element)
{ {
global $conf;
$projectkey="fk_projet"; $projectkey="fk_projet";
switch ($table_element) switch ($table_element)
@@ -195,7 +196,7 @@ class FormProjets
if (!empty($this->societe->id)) { if (!empty($this->societe->id)) {
$sql.= " AND fk_soc=".$this->societe->id; $sql.= " AND fk_soc=".$this->societe->id;
} }
$sql.= ' AND entity='.$conf->entity; $sql.= ' AND entity='.getEntity('project');
$sql.= " ORDER BY ref DESC"; $sql.= " ORDER BY ref DESC";
dol_syslog(get_class($this).'::select_element sql='.$sql,LOG_DEBUG); dol_syslog(get_class($this).'::select_element sql='.$sql,LOG_DEBUG);
@@ -219,6 +220,10 @@ class FormProjets
return $sellist ; return $sellist ;
$this->db->free($resql); $this->db->free($resql);
}else {
$this->error=$this->db->lasterror();
dol_syslog(get_class($this) . "::select_element " . $errmsg, LOG_ERR);
return -1;
} }
} }

View File

@@ -209,13 +209,18 @@ foreach ($listofreferent as $key => $value)
$classname=$value['class']; $classname=$value['class'];
$tablename=$value['table']; $tablename=$value['table'];
$qualified=$value['test']; $qualified=$value['test'];
if ($qualified) if ($qualified)
{ {
print '<br>'; print '<br>';
print_titre($langs->trans($title)); print_titre($langs->trans($title));
$selectList=$formproject->select_element($tablename); $selectList=$formproject->select_element($tablename);
if ($selectList<0) {
setEventMessage($formproject->error,'errors');
}
if ($selectList) if ($selectList)
{ {
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';