From deca41ba526244210aad48bb8c53813452bcfadb Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sat, 3 Aug 2013 22:58:42 -0500 Subject: [PATCH] Fixing issue 12 --- indefero/src/IDF/Views.php | 13 +++++++++---- indefero/src/IDF/templates/idf/user/public.html | 8 ++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/indefero/src/IDF/Views.php b/indefero/src/IDF/Views.php index 3940567..4fa96ed 100644 --- a/indefero/src/IDF/Views.php +++ b/indefero/src/IDF/Views.php @@ -477,10 +477,15 @@ class IDF_Views $ids[] = $row->model_id; } } - $sql = new Pluf_SQL(sprintf("id IN (%s)", implode(", ", $ids))); - return Pluf::factory('IDF_Project')->getList(array( - 'filter'=> $sql->gen(), - )); + if (count($ids) > 0) + { + $sql = new Pluf_SQL(sprintf("id IN (%s)", implode(", ", $ids))); + return Pluf::factory('IDF_Project')->getList(array( + 'filter'=> $sql->gen(), + )); + } else { + return null; + } } /** diff --git a/indefero/src/IDF/templates/idf/user/public.html b/indefero/src/IDF/templates/idf/user/public.html index f5bd5e1..5a97dc2 100644 --- a/indefero/src/IDF/templates/idf/user/public.html +++ b/indefero/src/IDF/templates/idf/user/public.html @@ -46,6 +46,7 @@ Projects: +{if $projects} {foreach $projects as $p} {if $p.private == 0} @@ -55,6 +56,13 @@ Projects: {/if} {/foreach} +{else} + + + +{/if}
+ This user is not working on any projects +
Issues user is working on:

{$issues.render}