View Issue Details

IDProjectCategoryView StatusLast Update
04594User patchesOtherpublic2010-12-14 13:02
Reporteruser9586Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version1.91 
Summary04594: Allow to hide the progress bar.
Description

When using a lot of conditional questions, the progress bar jumps a lot. More so when displaying the survey 'group by group'. Our Q/A requested an option to disable it on a survey basis.

Additional Information

This patch adds a new field into prefix_surveys named 'showprogress' and the relative option in the admin interface, bumping $dbversion to 144. The code is only implemented for mysql though.

TagsNo tags attached.
Complete LimeSurvey version number (& build)9114

Activities

c_schmitz

c_schmitz

2010-10-11 23:55

administrator   ~13095

Can you please provide the patch as a subversion patch (svn diff) against our 1.91 development version at the subversion branch at :
https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev

Thank you!

user9586

2010-11-05 17:51

 

patch-svn.diff (5,384 bytes)
Index: group.php
===================================================================
--- group.php	(revision 9421)
+++ group.php	(working copy)
@@ -444,11 +444,16 @@
         $upload_file = TRUE;
 } //end iteration
 
-if ($show_empty_group) {
-    $percentcomplete = makegraph($_SESSION['totalsteps']+1, $_SESSION['totalsteps']);
-} else
+if ($thissurvey['showprogress'] == 'Y')
 {
-    $percentcomplete = makegraph($_SESSION['step'], $_SESSION['totalsteps']);
+    if ($show_empty_group)
+    {
+        $percentcomplete = makegraph($_SESSION['totalsteps']+1, $_SESSION['totalsteps']);
+    }
+    else
+    {
+        $percentcomplete = makegraph($_SESSION['step'], $_SESSION['totalsteps']);
+    }
 }
 $languagechanger = makelanguagechanger();
 
Index: question.php
===================================================================
--- question.php	(revision 9421)
+++ question.php	(working copy)
@@ -403,7 +403,10 @@
 }
 //------------------------END DEVELOPMENT OF QUESTION
 
-$percentcomplete = makegraph($_SESSION['step'], $_SESSION['totalsteps']);
+if ($thissurvey['showprogress'] == 'Y')
+{
+    $percentcomplete = makegraph($_SESSION['step'], $_SESSION['totalsteps']);
+}
 
 //READ TEMPLATES, INSERT DATA AND PRESENT PAGE
 sendcacheheaders();
Index: admin/html.php
===================================================================
--- admin/html.php	(revision 9421)
+++ admin/html.php	(working copy)
@@ -2872,6 +2872,21 @@
             $editsurvey .= ">".$clang->gT("No")."</option>\n"
             . "</select></li>\n";
 
+	//Show Progress
+	$editsurvey .= "<li><label for='showprogress'>".$clang->gT("Show progress bar")."</label>\n"
+                . "<select id='showprogress' name='showprogress'>\n"
+                . "<option value='Y'";
+	if (!isset($esrow['showprogress']) || !$esrow['showprogress'] || $esrow['showprogress'] == "Y") {
+            $editsurvey .= " selected='selected'";
+        }
+	$editsurvey .= ">".$clang->gT("Yes")."</option>\n"
+                . "<option value='N'";
+	if (isset($esrow['showprogress']) && $esrow['showprogress'] == "N") {
+            $editsurvey .= " selected='selected'";
+        }
+	$editsurvey .= ">".$clang->gT("No")."</option>\n"
+                . "</select></li>\n";
+
             //Result printing
             $editsurvey .= "<li><label for='printanswers'>".$clang->gT("Participants may print answers?")."</label>\n"
             . "<select id='printanswers' name='printanswers'>\n"
Index: admin/database.php
===================================================================
--- admin/database.php	(revision 9421)
+++ admin/database.php	(working copy)
@@ -1073,6 +1073,7 @@
                             'shownoanswer'=>$_POST['shownoanswer'],
                             'showwelcome'=>$_POST['showwelcome'],
                             'allowprev'=>$_POST['allowprev'],
+                            'showprogress'=>$_POST['showprogress'],
                             'listpublic'=>$_POST['public'],
                             'htmlemail'=>$_POST['htmlemail'],
                             'tokenanswerspersistence'=>$_POST['tokenanswerspersistence'],
@@ -1362,6 +1363,7 @@
                             'shownoanswer'=>$_POST['shownoanswer'],
                             'showwelcome'=>$_POST['showwelcome'],
                             'allowprev'=>$_POST['allowprev'],
+                            'showprogress'=>$_POST['showprogress'],
                             'printanswers'=>$_POST['printanswers'],
         //                            'usetokens'=>$_POST['usetokens'],
                             'datecreated'=>date("Y-m-d"),
Index: admin/install/create-mysql.sql
===================================================================
--- admin/install/create-mysql.sql	(revision 9421)
+++ admin/install/create-mysql.sql	(working copy)
@@ -289,6 +289,7 @@
   `emailresponseto` text default NULL,  
   `emailnotificationto` text default NULL,
   `tokenlength` tinyint(2) default '15',
+  `showprogress` char(1) default 'Y',
    PRIMARY KEY(`sid`)
 ) ENGINE=$databasetabletype CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
Index: admin/update/upgrade-mysql.php
===================================================================
--- admin/update/upgrade-mysql.php	(revision 9421)
+++ admin/update/upgrade-mysql.php	(working copy)
@@ -407,6 +407,7 @@
         modify_database("", "ALTER TABLE `prefix_surveys` ADD `bounceaccountencryption` VARCHAR(4) NULL"); echo $modifyoutput; flush();
         modify_database("", "ALTER TABLE `prefix_surveys` ADD `bounceaccountuser` VARCHAR(320) NULL"); echo $modifyoutput; flush();
         modify_database("", "ALTER TABLE `prefix_surveys` ADD `showwelcome` CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();
+        modify_database("", "ALTER TABLE `prefix_surveys` ADD `showprogress` char(1) default 'Y'"); echo $modifyoutput; flush();
         modify_database("", "CREATE TABLE `prefix_survey_permissions` (
                                 `sid` int(10) unsigned NOT NULL,
                                 `uid` int(10) unsigned NOT NULL,
@@ -438,7 +439,6 @@
         modify_database("", "UPDATE `prefix_settings_global` SET `stg_value`='145' WHERE stg_name='DBVersion'"); echo $modifyoutput; flush();
     }
 
-
     echo '<br /><br />Database update finished ('.date('Y-m-d H:i:s').')<br />';
     return true;
 }
patch-svn.diff (5,384 bytes)

user9586

2010-11-05 17:51

  ~13434

Also updated against latest SVN tree.

c_schmitz

c_schmitz

2010-11-05 18:46

administrator   ~13438

Thank you. But adding it for the other databases would have been easy - I did it for you now ;).

Issue History

Date Modified Username Field Change
2010-09-10 19:05 user9586 New Issue
2010-09-10 19:05 user9586 File Added: patch.diff
2010-10-11 23:55 c_schmitz Status new => feedback
2010-10-11 23:55 c_schmitz Note Added: 13095
2010-11-05 17:51 user9586 File Added: patch-svn.diff
2010-11-05 17:51 user9586 Note Added: 13434
2010-11-05 17:51 user9586 Status feedback => new
2010-11-05 18:32 c_schmitz File Deleted: patch.diff
2010-11-05 18:45 c_schmitz Assigned To => c_schmitz
2010-11-05 18:45 c_schmitz Status new => assigned
2010-11-05 18:46 c_schmitz Note Added: 13438
2010-11-05 18:46 c_schmitz Status assigned => resolved
2010-11-05 18:46 c_schmitz Fixed in Version => 1.91
2010-11-05 18:46 c_schmitz Resolution open => fixed
2010-12-14 13:02 c_schmitz Status resolved => closed