Skip to content

Commit

Permalink
Fixed issue : All question attribute is not included in TSV export (c…
Browse files Browse the repository at this point in the history
…ssclass)

Dev: now : all existing attribute in this installation was exported (future and/or plugin)
  • Loading branch information
Shnoulle committed Jul 27, 2016
1 parent 64bd20d commit ca0aad9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 131 deletions.
148 changes: 18 additions & 130 deletions application/helpers/expressions/em_manager_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -9687,139 +9687,27 @@ static public function ShowSurveyLogicFile($sid, $gid=NULL, $qid=NULL,$LEMdebugL
*/
static public function &TSVSurveyExport($sid)
{
$fields = array(
'class',
'type/scale',
'name',
'relevance',
'text',
'help',
'language',
'validation',
'mandatory',
'other',
'default',
'same_default',
// Advanced question attributes : @todo get used question attribute by question in survey ?
'allowed_filetypes',
'alphasort',
'answer_width',
'array_filter',
'array_filter_exclude',
'array_filter_style',
'assessment_value',
'category_separator',
'choice_title',
'code_filter',
'commented_checkbox',
'commented_checkbox_auto',
'date_format',
'date_max',
'date_min',
'display_columns',
'display_rows',
'dropdown_dates',
'dropdown_dates_minute_step',
'dropdown_dates_month_style',
'dropdown_prefix',
'dropdown_prepostfix',
'dropdown_separators',
'dropdown_size',
'dualscale_headerA',
'dualscale_headerB',
'em_validation_q',
'em_validation_q_tip',
'em_validation_sq',
'em_validation_sq_tip',
'equals_num_value',
'exclude_all_others',
'exclude_all_others_auto',
'hidden',
'hide_tip',
'input_boxes',
'location_city',
'location_country',
'location_defaultcoordinates',
'location_mapheight',
'location_mapservice',
'location_mapwidth',
'location_mapzoom',
'location_nodefaultfromip',
'location_postal',
'location_state',
'max_answers',
'max_filesize',
'max_num_of_files',
'max_num_value',
'max_num_value_n',
'maximum_chars',
'min_answers',
'min_num_of_files',
'min_num_value',
'min_num_value_n',
'multiflexible_checkbox',
'multiflexible_max',
'multiflexible_min',
'multiflexible_step',
'num_value_int_only',
'numbers_only',
'other_comment_mandatory',
'other_numbers_only',
'other_replace_text',
'page_break',
'parent_order',
'prefix',
'printable_help',
'public_statistics',
'random_group',
'random_order',
'rank_title',
'repeat_headings',
'reverse',
'samechoiceheight',
'samelistheight',
'scale_export',
'show_comment',
'show_grand_total',
'show_title',
'show_totals',
'showpopups',
'slider_accuracy',
'slider_default',
'slider_layout',
'slider_max',
'slider_middlestart',
'slider_min',
'slider_rating',
'slider_reset',
'slider_separator',
'slider_showminmax',
'statistics_graphtype',
'statistics_showgraph',
'statistics_showmap',
'suffix',
'text_input_width',
'time_limit',
'time_limit_action',
'time_limit_countdown_message',
'time_limit_disable_next',
'time_limit_disable_prev',
'time_limit_message',
'time_limit_message_delay',
'time_limit_message_style',
'time_limit_timer_style',
'time_limit_warning',
'time_limit_warning_2',
'time_limit_warning_2_display_time',
'time_limit_warning_2_message',
'time_limit_warning_2_style',
'time_limit_warning_display_time',
'time_limit_warning_message',
'time_limit_warning_style',
'use_dropdown',

$aBaseFields = array(
'class',
'type/scale',
'name',
'relevance',
'text',
'help',
'language',
'validation',
'mandatory',
'other',
'default',
'same_default',
);

// Advanced question attributes : @todo get used question attribute by question in survey ?
$aQuestionAttributes=array_keys(QuestionAttribute::getAttributesDefinitions());
sort($aQuestionAttributes);
$fields=array_merge($aBaseFields,$aQuestionAttributes);

$rows = array();
$primarylang='en';
$otherlangs='';
Expand Down
3 changes: 2 additions & 1 deletion application/models/QuestionAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,8 @@ public static function getAttributesDefinitions()
*/
$event = new PluginEvent('newQuestionAttributes');
$result = App()->getPluginManager()->dispatchEvent($event);
$questionAttributes = $result->get('questionAttributes');
/* Cast as array , or test if exist , or set to an empty array at start (or to $qattributes : and do $qattributes=$result->get('questionAttributes') directly ) ? */
$questionAttributes =(array) $result->get('questionAttributes');
$qattributes=array_merge($qattributes,$questionAttributes);

self::$attributesDefinitions = $qattributes;
Expand Down

0 comments on commit ca0aad9

Please sign in to comment.