def series_prepare_matrix(series_id, series, logo, lang_dict, justified=False):
 template = s3db.survey_getTemplateFromSeries(series_id)
 template_id = template.id
 section_list = s3db.survey_getAllSectionsForSeries(series_id)
 survey_T = s3db.survey_T
 title = ('%s (%s)' % (series.name, template.name))
 title = survey_T(title, lang_dict)
 layout = []
 survey_getQstnLayoutRules = s3db.survey_getQstnLayoutRules
 for section in section_list:
  section_name = survey_T(section['name'], lang_dict)
  rules = survey_getQstnLayoutRules(template_id, section['section_id'])
  layout_rules = [section_name, rules]
  layout.append(layout_rules)
 widget_list = s3db.survey_getAllWidgetsForTemplate(template_id)
 layout_blocks = s3db.survey_LayoutBlocks()
 preliminary_matrix = s3db.survey_getMatrix(title, logo, layout, widget_list, False, lang_dict, showSectionLabels=False, layoutBlocks=layout_blocks)
 if (not justified):
  return preliminary_matrix
 layout_blocks.align()
 layout_blocks = s3db.survey_LayoutBlocks()
 (matrix1, matrix2) = s3db.survey_getMatrix(title, logo, layout, widget_list, True, lang_dict, showSectionLabels=False)
 return (matrix1, matrix2)

def series_prepare_matrix ( series_id , series , logo , lang_dict , justified = False ) : template = s3db . survey_getTemplateFromSeries ( series_id ) template_id = template . id section_list = s3db . survey_getAllSectionsForSeries ( series_id ) survey_T = s3db . survey_T title = ( '%s (%s)' % ( series . name , template . name ) ) title = survey_T ( title , lang_dict ) layout = [ ] survey_getQstnLayoutRules = s3db . survey_getQstnLayoutRules for section in section_list : section_name = survey_T ( section [ 'name' ] , lang_dict ) rules = survey_getQstnLayoutRules ( template_id , section [ 'section_id' ] ) layout_rules = [ section_name , rules ] layout . append ( layout_rules ) widget_list = s3db . survey_getAllWidgetsForTemplate ( template_id ) layout_blocks = s3db . survey_LayoutBlocks ( ) preliminary_matrix = s3db . survey_getMatrix ( title , logo , layout , widget_list , False , lang_dict , showSectionLabels = False , layoutBlocks = layout_blocks ) if ( not justified ) : return preliminary_matrix layout_blocks . align ( ) layout_blocks = s3db . survey_LayoutBlocks ( ) ( matrix1 , matrix2 ) = s3db . survey_getMatrix ( title , logo , layout , widget_list , True , lang_dict , showSectionLabels = False ) return ( matrix1 , matrix2 )
helper function for series_export_formatted() .