changeset 798:b97d4b754bc0

Show also empty compos with RFLAG_HIDDEN_COMPOS.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 21 Nov 2014 23:57:11 +0200
parents 7126403af18f
children cce7307d2c75
files admajax.php msite.inc.php
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/admajax.php	Fri Nov 21 23:56:50 2014 +0200
+++ b/admajax.php	Fri Nov 21 23:57:11 2014 +0200
@@ -1389,7 +1389,7 @@
           "<div class=\"ctrlModeControls\">\n".
           " <a href=\"print.php?type=results&flags=".(RFLAG_NORMAL)."\" target=\"_blank\">Printable results</a>\n".
           " <a href=\"print.php?type=results&flags=".(RFLAG_DISQUALIFIED)."\" target=\"_blank\">Printable full results</a> (shows also disqualified entries)\n".
-          " <a href=\"print.php?type=results&flags=".(RFLAG_DISQUALIFIED | RFLAG_HIDDEN_COMPOS)."\" target=\"_blank\">Printable FULL results</a> (shows also hidden compos)\n".
+          " <a href=\"print.php?type=results&flags=".(RFLAG_DISQUALIFIED | RFLAG_HIDDEN_COMPOS)."\" target=\"_blank\">Printable FULL results</a> (shows also hidden and empty compos)\n".
           "</div>\n".
           "<form method=\"post\" action=\"\" onsubmit=\"return addCompo()\">\n".
           "  ".stGetFormTextInput(64, SET_LEN_COMPO_NAME, "", "ncname", "", "")."<br />\n".
--- a/msite.inc.php	Fri Nov 21 23:56:50 2014 +0200
+++ b/msite.inc.php	Fri Nov 21 23:57:11 2014 +0200
@@ -553,7 +553,8 @@
       "WHERE compo_id=".$compo["id"].
       (($flags & RFLAG_DISQUALIFIED) ? "" : " AND (entries.flags & ".EFLAG_DISQUALIFIED.")=0");
 
-    if (($nentries = stFetchSQLColumn($sql)) !== FALSE && $nentries > 0)
+    if (($nentries = stFetchSQLColumn($sql)) !== FALSE &&
+        ($nentries > 0 || ($flags & RFLAG_HIDDEN_COMPOS)))
     {
       // Get voting results by mode
       $sql = stGetCompoResultsSQL($voteKeyMode, $compo, $flags);