Skip to content

Commit

Permalink
Add groupSec property.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronschmitz committed Jun 4, 2012
1 parent eb12ae0 commit f038cbf
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 18 deletions.
10 changes: 2 additions & 8 deletions application/helpers/common_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2070,22 +2070,16 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
$fieldname="{$arow['sid']}X{$arow['gid']}X{$arow['qid']}";
$pq = createQuestion($arow->question_types['class'], $surveyid, $arow['qid'], $fieldname,
$arow['title'], $arow['question'], $arow['gid'], $arow['mandatory'], $conditions,
$usedinconditions, $questionSeq, $groupSeq, $sLanguage);
$usedinconditions, $questionSeq, null, $sLanguage);
$pq->aid = '';
if(isset($defaults[$arow['qid']])) $pq->default = $defaults[$arow['qid']];

$pq->preg = $arow['preg'];
$pq->other = $arow['other'];
$pq->groupname = $arow->groups['group_name'];
$pq->groupcount = $groupSeq;
$add = $pq->createFieldmap($arow['type']);

foreach($add as $key=>$value)
{
unset($add[$key]['q']);
unset($add[$key]['pq']);
}


if (count($add))
{
$tmp=array_values($add);
Expand Down
2 changes: 1 addition & 1 deletion application/modules/ArrayQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function createFieldmap($type=null)
$field['hasconditions']=$this->conditionsexist;
$field['usedinconditions']=$this->usedinconditions;
$field['questionSeq']=$this->questioncount;
$field['groupSeq']=$this->randomgid;
$field['groupSeq']=$this->groupcount;
$field['preg']=$this->preg;
if(isset($this->default[$abrow['qid']])) $field['defaultvalue']=$this->default[$abrow['qid']];
$field['pq']=$this;
Expand Down
2 changes: 1 addition & 1 deletion application/modules/CheckQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function createFieldmap($type=null)
$field['hasconditions']=$this->conditionsexist;
$field['usedinconditions']=$this->usedinconditions;
$field['questionSeq']=$this->questioncount;
$field['groupSeq']=$this->randomgid;
$field['groupSeq']=$this->groupcount;
$field['preg']=$this->preg;
if(isset($this->default[$abrow['qid']])) $field['defaultvalue']=$this->default[$abrow['qid']];
$field['pq']=$this;
Expand Down
23 changes: 23 additions & 0 deletions application/modules/DateQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,29 @@ public function getAnswerHTML()

return $answer;
}

public function filterGET($value)
{
global $thissurvey;
if (trim($value)=="")
{
return NULL;
}
else
{
$dateformatdatat=getDateFormatData($thissurvey['surveyls_dateformat']);
$datetimeobj = new Date_Time_Converter($value, $dateformatdatat['phpdate']);
return $datetimeobj->convert("Y-m-d");
}
}

public function prepareValue($value)
{
if (trim($val)=='') {
return NULL;
}
return $value;
}

public function availableAttributes($attr = false)
{
Expand Down
2 changes: 1 addition & 1 deletion application/modules/DualRadioArrayQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ public function createFieldmap($type=null)
$field['hasconditions']=$this->conditionsexist;
$field['usedinconditions']=$this->usedinconditions;
$field['questionSeq']=$this->questioncount;
$field['groupSeq']=$this->randomgid;
$field['groupSeq']=$this->groupcount;
$field['pq']=$this;
$q = clone $this;
$q->fieldname = $fieldname;
Expand Down
12 changes: 11 additions & 1 deletion application/modules/FileQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function createFieldmap($type=null)
$field['hasconditions']=$this->conditionsexist;
$field['usedinconditions']=$this->usedinconditions;
$field['questionSeq']=$this->questioncount;
$field['groupSeq']=$this->randomgid;
$field['groupSeq']=$this->groupcount;
$field['pq']=$this;
$field['q']=$this;
$field2=$field;
Expand All @@ -212,6 +212,16 @@ public function createFieldmap($type=null)
return $map;
}

public function fileUpload()
{
return true;
}

public function filterGET($value)
{
return NULL;
}

public function availableAttributes($attr = false)
{
$attrs=array("statistics_showgraph","statistics_graphtype","hide_tip","hidden","page_break","show_title","show_comment","max_filesize","max_num_of_files","min_num_of_files","allowed_filetypes","random_group");
Expand Down
20 changes: 19 additions & 1 deletion application/modules/MultinumericalQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public function createFieldmap($type=null)
$field['hasconditions']=$this->conditionsexist;
$field['usedinconditions']=$this->usedinconditions;
$field['questionSeq']=$this->questioncount;
$field['groupSeq']=$this->randomgid;
$field['groupSeq']=$this->groupcount;
$field['preg']=$this->preg;
if(isset($this->default[$abrow['qid']])) $field['defaultvalue']=$this->default[$abrow['qid']];
$field['pq']=$this;
Expand All @@ -375,6 +375,24 @@ public function createFieldmap($type=null)
}
return $map;
}

public function filterGET($value)
{
if (trim($value)=="") {
return NULL;
}
else {
return sanitize_float($value);
}
}

public function prepareValue($value)
{
if (trim($val)=='') {
return NULL;
}
return $value;
}

public function availableAttributes($attr = false)
{
Expand Down
2 changes: 1 addition & 1 deletion application/modules/MultitextQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function createFieldmap($type=null)
$field['hasconditions']=$this->conditionsexist;
$field['usedinconditions']=$this->usedinconditions;
$field['questionSeq']=$this->questioncount;
$field['groupSeq']=$this->randomgid;
$field['groupSeq']=$this->groupcount;
$field['preg']=$this->preg;
if(isset($this->default[$abrow['qid']])) $field['defaultvalue']=$this->default[$abrow['qid']];
$field['pq']=$this;
Expand Down
2 changes: 1 addition & 1 deletion application/modules/NumberArrayQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public function createFieldmap($type=null)
$field['hasconditions']=$this->conditionsexist;
$field['usedinconditions']=$this->usedinconditions;
$field['questionSeq']=$this->questioncount;
$field['groupSeq']=$this->randomgid;
$field['groupSeq']=$this->groupcount;
$field['preg']=$this->preg;
$field['answerList']=$answerList;
$q = clone $this;
Expand Down
18 changes: 18 additions & 0 deletions application/modules/NumericalQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ public function getAnswerHTML()

return $answer;
}

public function filterGET($value)
{
if (trim($value)=="") {
return NULL;
}
else {
return sanitize_float($value);
}
}

public function prepareValue($value)
{
if (trim($val)=='') {
return NULL;
}
return $value;
}

public function availableAttributes($attr = false)
{
Expand Down
18 changes: 17 additions & 1 deletion application/modules/QuestionModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ abstract class QuestionModule
public $conditionsexist; //boolean
public $usedinconditions;
public $questioncount;
public $groupcount;
public $randomgid;
public $language;
public $groupname;
Expand Down Expand Up @@ -160,13 +161,28 @@ public function createFieldmap($type=null)
$map['hasconditions']=$this->conditionsexist;
$map['usedinconditions']=$this->usedinconditions;
$map['questionSeq']=$this->questioncount;
$map['groupSeq']=$this->randomgid;
$map['groupSeq']=$this->groupcount;
if(isset($this->default[0])) $map['defaultvalue']=$this->default[0];
$map['q']=$this;
$map['pq']=$this;
return array($this->fieldname=>$map);
}

public function fileUpload()
{
return false;
}

public function filterGET($value)
{
return $value;
}

public function prepareValue($value)
{
return $value;
}

abstract public function availableAttributes($attr = false);
abstract public function questionProperties($prop = false);
}
Expand Down
2 changes: 1 addition & 1 deletion application/modules/RankingQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function createFieldmap($type=null)
$field['hasconditions']=$this->conditionsexist;
$field['usedinconditions']=$this->usedinconditions;
$field['questionSeq']=$this->questioncount;
$field['groupSeq']=$this->randomgid;
$field['groupSeq']=$this->groupcount;
$field['pq']=$this;
$q = clone $this;
$q->fieldname = $fieldname;
Expand Down
2 changes: 1 addition & 1 deletion application/modules/TextArrayQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public function createFieldmap($type=null)
$field['hasconditions']=$this->conditionsexist;
$field['usedinconditions']=$this->usedinconditions;
$field['questionSeq']=$this->questioncount;
$field['groupSeq']=$this->randomgid;
$field['groupSeq']=$this->groupcount;
$field['preg']=$this->preg;
$field['answerList']=$answerList;
$q = clone $this;
Expand Down

0 comments on commit f038cbf

Please sign in to comment.