View Issue Details

IDProjectCategoryView StatusLast Update
04589User patchesOtherpublic2010-12-14 13:02
Reporteruser9586Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.90 
Target VersionFixed in Version1.91 
Summary04589: Allow to reverse year order in dropdown dates.
Description

This patch allows to reverse the year order of the date question type, with "Display select boxes" enabled.

Reverse ordering can be achieved by setting a min year higher than max year.

Requested by our Q/A group, as many people expected dates to be in ascending order.

Additional Information

I've tuned the sort order of the "min/max" parameters so that they are consecutive.

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

Relationships

related to 04588 closedc_schmitz Allow to reverse iteration order in Array (Numbers). 

Activities

c_schmitz

c_schmitz

2010-10-11 21:33

administrator   ~13085

Wavex, this is great but github patches are really annoying and hard to patch.
It would be great if in general you can provide subversion patches (created against our repository)

c_schmitz

c_schmitz

2010-10-11 21:37

administrator   ~13086

Another thought: Wouldn't it be easier to just introduce a new question attribute: 'Reverse ordering'?
Implicit settings (settings which are not obvious) is always really bad usablity.
Wavex, do you think you could change this feature to use a question attribute instead?

c_schmitz

c_schmitz

2010-10-11 23:55

administrator   ~13088

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-04 16:11

 

patch-svn.diff (1,644 bytes)
Index: common_functions.php
===================================================================
--- common_functions.php	(revision 9414)
+++ common_functions.php	(working copy)
@@ -3503,7 +3503,7 @@
     $qattributes["dropdown_dates_year_min"]=array(
     "types"=>"D",
     'category'=>$clang->gT('Display'),
-    'sortorder'=>100,
+    'sortorder'=>110,
     'inputtype'=>'text',
     "help"=>$clang->gT('Minimum year value in calendar'),
     "caption"=>$clang->gT('Minimum year'));
@@ -3511,7 +3511,7 @@
     $qattributes["dropdown_dates_year_max"]=array(
     "types"=>"D",
     'category'=>$clang->gT('Display'),
-    'sortorder'=>100,
+    'sortorder'=>111,
     'inputtype'=>'text',
     "help"=>$clang->gT('Maximum year value for calendar'),
     "caption"=>$clang->gT('Maximum year'));
@@ -3694,7 +3694,7 @@
     "caption"=>$clang->gT('Checkbox layout'));
 
     $qattributes["reverse"]=array(
-    "types"=>":",
+    "types"=>"D:",
     'category'=>$clang->gT('Display'),
     'sortorder'=>100,
     'inputtype'=>'singleselect',
Index: qanda.php
===================================================================
--- qanda.php	(revision 9414)
+++ qanda.php	(working copy)
@@ -1791,6 +1791,15 @@
 
                 if ($yearmin > $yearmax)
                 {
+                    $yearmin = 1900;
+                    $yearmax = 2020;
+                }
+
+                if ($qidattributes['reverse']==1)
+                {
+                    $tmp = $yearmin;
+                    $yearmin = $yearmax;
+                    $yearmax = $tmp;
                     $step = 1;
                     $reverse = true;
                 }
patch-svn.diff (1,644 bytes)

user9586

2010-11-04 16:11

  ~13425

Updated to use the 'reverse' attribute as previously introduced.

user9586

2010-11-04 16:53

  ~13426

(this is the next patch, just in case)

c_schmitz

c_schmitz

2010-11-05 17:29

administrator   ~13432

Thank you - Patch applied. What's next? ;)

Issue History

Date Modified Username Field Change
2010-09-09 12:11 user9586 New Issue
2010-09-09 12:11 user9586 File Added: patch.diff
2010-10-11 21:33 c_schmitz Note Added: 13085
2010-10-11 21:37 c_schmitz Note Added: 13086
2010-10-11 21:37 c_schmitz Assigned To => c_schmitz
2010-10-11 21:37 c_schmitz Status new => feedback
2010-10-11 21:38 c_schmitz Relationship added related to 04588
2010-10-11 23:55 c_schmitz Note Added: 13088
2010-11-04 16:11 user9586 File Added: patch-svn.diff
2010-11-04 16:11 user9586 Note Added: 13425
2010-11-04 16:11 user9586 Status feedback => assigned
2010-11-04 16:53 user9586 Note Added: 13426
2010-11-04 22:49 c_schmitz File Deleted: patch.diff
2010-11-05 17:29 c_schmitz Note Added: 13432
2010-11-05 17:29 c_schmitz Status assigned => resolved
2010-11-05 17:29 c_schmitz Fixed in Version => 1.91
2010-11-05 17:29 c_schmitz Resolution open => fixed
2010-12-14 13:02 c_schmitz Status resolved => closed