diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 4f08e6f4209..0a738846363 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -393,7 +393,7 @@ class Dolresource extends CommonObject
}
}
}
- $sql.= " GROUP BY t.rowid, ty.label";
+ $sql.= " GROUP BY t.rowid, t.entity, t.ref, t.description, t.fk_code_type_resource, t.tms, ty.label";
$sql.= $this->db->order($sortfield,$sortorder);
$this->num_all = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php
index 777bcb374d6..90eed125284 100644
--- a/htdocs/resource/list.php
+++ b/htdocs/resource/list.php
@@ -97,20 +97,18 @@ if($ret == -1) {
} else {
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret+1, $object->num_all,'title_generic.png');
}
-if(!$ret) {
- print '
'.$langs->trans('NoResourceInDatabase').'
';
-}
-else
+
+$var=true;
+
+print ''."\n";
+print '';
+print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'t.ref','',$param,'',$sortfield,$sortorder);
+print_liste_field_titre($langs->trans('ResourceType'),$_SERVER['PHP_SELF'],'ty.code','',$param,'',$sortfield,$sortorder);
+print_liste_field_titre('',"","","","",'width="60" align="center"',"","");
+print "
\n";
+
+if ($ret)
{
- $var=true;
-
- print ''."\n";
- print '';
- print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'t.ref','',$param,'',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('ResourceType'),$_SERVER['PHP_SELF'],'ty.code','',$param,'',$sortfield,$sortorder);
- print_liste_field_titre('',"","","","",'width="60" align="center"',"","");
- print "
\n";
-
foreach ($object->lines as $resource)
{
$var=!$var;
@@ -142,7 +140,10 @@ else
}
print '
';
-
+}
+else
+{
+ print '| '.$langs->trans('NoResourceInDatabase').' |
';
}
llxFooter();