コード例 #1
0
 public static function outputCreateReportTable($report_id = null)
 {
     global $lang, $Proj, $surveys_enabled, $user_rights;
     // Get report_id
     $report_id = $report_id == null ? 0 : $report_id;
     // Get report attributes
     $report = self::getReports($report_id);
     // Create array of all field validation types and their attributes
     $allValTypes = getValTypes();
     // Set counter for number of fields in report + number of limiters used
     $field_counter = $limiter_counter = 1;
     // Get all field drop-down options
     $rc_field_dropdown_options = self::getFieldDropdownOptions();
     //Form::getFieldDropdownOptions();
     $rc_field_dropdown_options_orderby = self::getFieldDropdownOptions(true);
     //Form::getFieldDropdownOptions(true);
     /*		// Get all forms as drop-down list
     		$addFormFieldsDropDownOptions = array(''=>'-- '.$lang['report_builder_101'].' --');
     		foreach ($Proj->forms as $key=>$attr) {
     			$addFormFieldsDropDownOptions[$key] = $attr['menu'];
     		}		*/
     // Get list of User Roles
     $role_dropdown_options = array();
     foreach (UserRights::getRoles() as $role_id => $attr) {
         $role_dropdown_options[$role_id] = $attr['role_name'];
     }
     // Get list of all DAGs, events, users, and records
     $dag_dropdown_options = $Proj->getGroups();
     $user_dropdown_options = User::getProjectUsernames(array(), true);
     $event_dropdown_options = $event_dropdown_options_with_all = array();
     //		if ($Proj->longitudinal) {
     foreach ($Proj->eventInfo as $this_event_id => $attr) {
         $event_dropdown_options[$this_event_id] = $attr['name_ext'];
     }
     $event_dropdown_options_with_all = array('' => $lang['dataqueries_136']) + $event_dropdown_options;
     //		}
     $user_access_radio_custom_checked = $report['user_access'] != 'ALL' ? 'checked' : '';
     $user_access_radio_all_checked = $report['user_access'] == 'ALL' ? 'checked' : '';
     if ($report['user_access'] == 'ALL') {
         // If ALL is selected, then remove custom options
         $report['user_access_users'] = $report['user_access_roles'] = $report['user_access_dags'] = array();
     }
     // Add blank values onto the end of some attributes to create empty row for user to enter a new field, filter, etc.
     $report['fields'][] = "";
     $report['limiter_fields'][] = array('field_name' => '', 'limiter_group_operator' => 'AND', 'limiter_event_id' => '', 'limiter_operator' => '', 'limiter_value' => '');
     // Instructions
     print RCView::div(array('style' => 'max-width:800px;margin:5px 0 20px;'), $lang['report_builder_118']);
     // Initialize table rows
     print "<div style='max-width:800px;'>\n\t\t\t\t <form id='create_report_form'>\n\t\t\t\t\t<table id='create_report_table' class='form_border' style='width:100%;'>";
     // Report title
     print RCView::tr(array(), RCView::td(array('class' => 'header nowrap', 'style' => 'text-align:center;padding-right:0;padding-left:0;color:#800000;height:50px;width:120px;font-size: 14px;'), $lang['report_builder_16']) . RCView::td(array('class' => 'header', 'colspan' => 3, 'style' => 'color:#800000;height:50px;padding:5px 10px;'), RCView::text(array('name' => '__TITLE__', 'value' => htmlspecialchars($report['title'], ENT_QUOTES), 'class' => 'x-form-text x-form-field', 'maxlength' => 60, 'style' => 'padding: 4px 6px 3px;font-size:16px;width:95%;'))));
     ## USER ACCESS
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom', 'style' => 'padding:0;background:#fff;border-left:0;border-right:0;height:45px;'), RCView::div(array('style' => 'color:#444;position:relative;top:10px;background-color:#ddd;border:1px solid #ccc;border-bottom:1px solid #ddd;float:left;padding:5px 8px;'), $lang['global_117'] . " 1")));
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom'), RCView::div(array('style' => ''), RCView::img(array('src' => 'group_add.png', 'class' => 'imgfix')) . $lang['extres_35'])));
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc', 'colspan' => 4, 'style' => 'padding-top:6px;padding-bottom:6px;'), RCView::div(array('style' => 'float:left;'), RCView::radio(array('name' => 'user_access_radio', 'onchange' => "displayUserAccessOptions()", 'class' => 'imgfix2', 'value' => 'ALL', $user_access_radio_all_checked => $user_access_radio_all_checked))) . RCView::div(array('style' => 'float:left;margin:2px 0 0 2px;'), $lang['control_center_182']) . RCView::div(array('style' => 'float:left;color:#888;font-weight:normal;margin:2px 20px 0 25px;'), "&ndash; " . $lang['global_46'] . " &ndash;") . RCView::div(array('style' => 'float:left;'), RCView::radio(array('name' => 'user_access_radio', 'onchange' => "displayUserAccessOptions()", 'class' => 'imgfix2', 'value' => 'SELECTED', $user_access_radio_custom_checked => $user_access_radio_custom_checked))) . RCView::div(array('style' => 'float:left;margin:2px 0 0 2px;'), RCView::div(array('style' => 'margin-bottom:10px;'), $lang['report_builder_62'] . RCView::span(array('id' => 'selected_users_note1', 'style' => ($report['user_access'] == 'ALL' ? 'display:none;' : '') . 'margin-left:10px;color:#800000;font-size:11px;font-weight:normal;'), $lang['report_builder_105']) . RCView::span(array('id' => 'selected_users_note2', 'style' => ($report['user_access'] != 'ALL' ? 'display:none;' : '') . 'margin-left:10px;color:#888;font-size:11px;font-weight:normal;'), $lang['report_builder_66'])) . RCView::div(array('id' => 'selected_users_div', 'style' => $report['user_access'] == 'ALL' ? 'display:none;' : ''), RCView::div(array('style' => 'margin-right:30px;float:left;font-weight:normal;vertical-align:top;'), $lang['extres_28'] . RCView::div(array('style' => 'margin-left:3px;'), RCView::select(array('name' => 'user_access_users', 'multiple' => '', 'class' => 'x-form-text x-form-field', 'style' => 'font-size:11px;padding-right:15px;height:70px;'), $user_dropdown_options, $report['user_access_users'], 200))) . (empty($role_dropdown_options) ? '' : RCView::div(array('style' => 'margin-right:30px;float:left;font-weight:normal;vertical-align:top;'), $lang['report_builder_61'] . RCView::div(array('style' => 'margin-left:3px;'), RCView::select(array('name' => 'user_access_roles', 'multiple' => '', 'class' => 'x-form-text x-form-field', 'style' => 'font-size:11px;padding-right:15px;height:70px;'), $role_dropdown_options, $report['user_access_roles'], 200)))) . (empty($dag_dropdown_options) ? '' : RCView::div(array('style' => 'float:left;font-weight:normal;vertical-align:top;'), $lang['extres_52'] . RCView::div(array('style' => 'margin-left:3px;'), RCView::select(array('name' => 'user_access_dags', 'multiple' => '', 'class' => 'x-form-text x-form-field', 'style' => 'font-size:11px;padding-right:15px;height:70px;'), $dag_dropdown_options, $report['user_access_dags'], 200)))) . RCView::div(array('style' => 'clear:both;padding:10px 0 0 3px;font-size:11px;font-weight:normal;color:#888;'), $lang['report_builder_40']) . RCView::div(array('style' => 'padding:5px 0 0 3px;font-size:11px;font-weight:normal;color:#222;'), $lang['report_builder_111'] . RCView::button(array('class' => 'jqbuttonsm', 'style' => 'margin-left:7px;font-family:arial;font-size:11px;', 'onclick' => "getUserAccessList();return false;"), $lang['report_builder_107']))))));
     ## FIELDS USED IN REPORT
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom', 'style' => 'padding:0;background:#fff;border-left:0;border-right:0;height:45px;'), RCView::div(array('style' => 'color:#444;position:relative;top:10px;background-color:#ddd;border:1px solid #ccc;border-bottom:1px solid #ddd;float:left;padding:5px 8px;'), $lang['global_117'] . " 2")));
     // "Fields" section header
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom'), RCView::div(array('style' => 'float:left;'), RCView::img(array('id' => 'dragndrop_tooltip_trigger', 'title' => $lang['report_builder_67'], 'src' => 'tags.png', 'class' => 'imgfix')) . $lang['report_builder_29']) . RCView::div(array('style' => 'float:left;margin-left:40px;'), RCView::button(array('class' => 'jqbuttonsm', 'style' => 'color:green;font-size:11px;font-family:arial;', 'onclick' => "openQuickAddDialog(this); return false;"), RCView::img(array('src' => 'plus_small2.png', 'style' => 'vertical-align:middle;')) . RCView::span(array('style' => 'vertical-align:middle;'), $lang['report_builder_136'])) . RCView::img(array('src' => 'progress_circle.gif', 'id' => 'imgQAProgress', 'style' => 'display:none;')))));
     // Fill rows of fields (only for existing reports)
     foreach ($report['fields'] as $this_field) {
         $fname = self::getFieldFromEventField($this_field);
         print RCView::tr(array('class' => 'field_row'), RCView::td(array('class' => 'labelrc ' . ($this_field != '' ? 'dragHandle' : ''), 'style' => 'width:120px;'), RCView::div(array('style' => 'line-height:20px;'), RCView::span(array('style' => 'margin-left:25px;'), $lang['graphical_view_23'] . " ") . RCView::span(array('class' => 'field_num'), $field_counter++))) . RCView::td(array('class' => 'labelrc', 'colspan' => 2), RCView::div(array('class' => 'field-auto-suggest-div', 'style' => $this_field != '' ? 'display:none;' : ''), self::outputFieldAutoSuggest() . RCView::button(array('title' => $lang['report_builder_32'], 'class' => 'jqbuttonsm field-dropdown-a', 'onclick' => "showReportFieldAutoSuggest(\$(this),true);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'dropdown.png', 'style' => 'vertical-align:middle;')))) . RCView::div(array('class' => 'field-dropdown-div', 'style' => $this_field == '' ? 'display:none;' : ''), RCView::div(array('style' => 'float:left;'), self::outputFieldDropdown($rc_field_dropdown_options, $this_field) . RCView::button(array('title' => $lang['report_builder_30'], 'class' => 'jqbuttonsm field-auto-suggest-a', 'onclick' => "showReportFieldAutoSuggest(\$(this),false);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'form-text-box.gif', 'style' => 'vertical-align:middle;')))) . RCView::div(array('class' => 'fn'), RCView::span(array('class' => 'fna'), $lang['design_493']) . RCView::span(array('class' => 'fnb'), $this_field == '' ? '' : $Proj->forms[$Proj->metadata[$fname]['form_name']]['menu'])) . RCView::div(array('class' => 'clear'), ''))) . RCView::td(array('class' => 'labelrc', 'style' => 'text-align:center;width:25px;'), RCView::a(array('href' => 'javascript:;', 'onclick' => "deleteReportField(\$(this));", 'style' => $this_field == '' ? 'display:none;' : ''), RCView::img(array('src' => 'cross.png', 'class' => 'imgfix opacity75', 'title' => $lang['design_170'])))));
     }
     ## ADDITIONAL FIELDS (OUTPUT DAG NAMES, OUTPUT SURVEY FIELDS, OUTPUT EVENT SCHEDULED DATES)
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom', 'style' => 'background:#fff;border-left:0;border-right:0;height:5px;'), ''));
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom'), RCView::div(array('style' => 'float:left;'), RCView::img(array('src' => 'tag_orange.png', 'class' => 'imgfix')) . $lang['report_builder_89'] . " " . RCView::span(array('style' => 'font-weight:normal;'), $lang['global_06']))));
     if (!empty($dag_dropdown_options)) {
         $exportDagOption = "";
         $outputDagChecked = $report['output_dags'] ? 'checked' : '';
         $exportDagOption = (print RCView::tr(array(), RCView::td(array('class' => 'labelrc', 'colspan' => 4, 'valign' => 'top', 'style' => ''), RCView::span(array('style' => 'margin:0 10px 0 20px;vertical-align:top;position:relative;top:4px;float:left;width:110px;'), $lang['global_114'] . ":") . RCView::checkbox(array('name' => 'output_dags', $outputDagChecked => $outputDagChecked)) . RCView::span(array('style' => 'margin:0 0 0 10px;vertical-align:top;position:relative;top:4px;font-weight:normal;'), $lang['data_export_tool_178']))));
     }
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc', 'colspan' => 4, 'valign' => 'top', 'style' => ''), RCView::div(array('style' => (!$Proj->longitudinal ? 'display:none;' : '') . 'float:left;margin-bottom:5px;'), RCView::span(array('style' => 'margin:0 10px 0 20px;vertical-align:top;position:relative;top:4px;float:left;width:110px;'), "Schedule Dates:") . RCView::select(array('multiple' => '', 'class' => 'x-form-text x-form-field', 'style' => 'font-size:11px;padding-right:15px;height:80px;', 'name' => 'output_schedule_dates'), $event_dropdown_options, $report['output_schedule_dates'], 200) . RCView::span(array('style' => 'margin:0 0 0 10px;vertical-align:top;position:relative;top:4px;font-weight:normal;'), "Include the date of the selected event(s) from the calendar for each record"))));
     if ($surveys_enabled) {
         // TODO Copy output_survey_fields to output_survey_queue_url ?
         /*                        $outputSurveyFieldsChecked = ($report['output_survey_fields']) ? 'checked' : '';
                                 $exportSurveyFieldsOptions = RCView::checkbox(array('name'=>'output_survey_fields', $outputSurveyFieldsChecked=>$outputSurveyFieldsChecked
                                         , 'disabled' => 'disabled')) . $lang['data_export_tool_179'];
                                 print   RCView::tr(array(),
                                                 RCView::td(array('class'=>'labelrc', 'colspan'=>4, 'valign'=>'top', 'style'=>'font-weight:normal;padding:8px;'),
                                                         $exportSurveyFieldsOptions
                                                 )
                                         );*/
         $surveyurl_dropdown_options = self::getSurveyUrlDropdownOptions();
         print RCView::tr(array(), RCView::td(array('class' => 'labelrc', 'colspan' => 4, 'valign' => 'top', 'style' => ''), RCView::div(array('style' => 'float:left;margin-bottom:5px;'), RCView::span(array('style' => 'margin:0 10px 0 20px;vertical-align:top;position:relative;top:4px;float:left;width:110px;'), "Survey URLs:") . RCView::select(array('multiple' => '', 'class' => 'x-form-text x-form-field', 'style' => 'font-size:11px;padding-right:15px;height:80px;', 'name' => 'output_survey_urls'), $surveyurl_dropdown_options, $report['output_survey_urls'], 200) . RCView::span(array('style' => 'margin:0 0 0 10px;vertical-align:top;position:relative;top:4px;font-weight:normal;'), "Include URL to the selected survey(s) for each record"))));
     }
     /*		if (!empty($dags) || $surveys_enabled) 
     		{
     			$exportDagOption = "";
     			$exportSurveyFieldsOptions = "";
     			if (!empty($dags)) {
     				$outputDagChecked = ($report['output_dags']) ? 'checked' : '';
     				$exportDagOption = RCView::checkbox(array('name'=>'output_dags', $outputDagChecked=>$outputDagChecked)) . 
     								   $lang['data_export_tool_178'];
     			}
     			if ($surveys_enabled) {
     				$outputSurveyFieldsChecked = ($report['output_survey_fields']) ? 'checked' : '';
     				$exportSurveyFieldsOptions = RCView::checkbox(array('name'=>'output_survey_fields', $outputSurveyFieldsChecked=>$outputSurveyFieldsChecked
                                             , 'disabled' => 'disabled')) . 
     											 $lang['data_export_tool_179'];
     			}
     			$exportDagSurveyFieldsOptions = $exportDagOption . RCView::br() . $exportSurveyFieldsOptions;
     			print   RCView::tr(array(),
     						RCView::td(array('class'=>'labelrc create_rprt_hdr', 'colspan'=>4, 'valign'=>'bottom', 
     							'style'=>'background:#fff;border-left:0;border-right:0;height:5px;'), '')
     					);
     			print   RCView::tr(array(),
     						RCView::td(array('class'=>'labelrc create_rprt_hdr', 'colspan'=>4, 'valign'=>'bottom'),
     							RCView::div(array('style'=>'float:left;'),
     								RCView::img(array('src'=>'tag_orange.png', 'class'=>'imgfix')) .
     								$lang['report_builder_89'] . " " .
     								RCView::span(array('style'=>'font-weight:normal;'), $lang['global_06'])
     							)
     						)
     					);
     			print   RCView::tr(array(),
     						RCView::td(array('class'=>'labelrc', 'colspan'=>4, 'valign'=>'top', 'style'=>'font-weight:normal;padding:8px;'),
     							$exportDagSurveyFieldsOptions
     						)
     					);
     		}*/
     ## LIMTERS
     // "Limiters" section header
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom', 'style' => 'padding:0;background:#fff;border-left:0;border-right:0;height:45px;'), RCView::div(array('style' => 'color:#444;position:relative;top:10px;background-color:#ddd;border:1px solid #ccc;border-bottom:1px solid #ddd;float:left;padding:5px 8px;'), $lang['global_117'] . " 3")));
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 2, 'valign' => 'bottom', 'style' => 'border-right:0;'), RCView::img(array('src' => 'filter_plus.gif', 'class' => 'imgfix')) . $lang['report_builder_35'] . " " . RCView::span(array('style' => 'font-weight:normal;'), $lang['global_06'])) . RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 2, 'valign' => 'bottom', 'style' => 'border-left:0;'), RCView::div(array('id' => 'oper_value_hdr', 'style' => $report['advanced_logic'] != '' ? 'display:none;' : ''), $lang['report_builder_19'])));
     // Fill rows of limiter fields (only for existing reports)
     $limiter_group_operator_options = array("OR" => $lang['global_46'], "AND" => $lang['global_87']);
     $limiter_field_num = 0;
     foreach ($report['limiter_fields'] as $attr) {
         // If doing a new "AND" group, then display extra row (but if not, then keep hidden via CSS)
         $display_limiter_and_row = $limiter_field_num > 0 && $attr['limiter_group_operator'] == 'AND';
         // Render "AND" row
         print RCView::tr(array('class' => 'limiter_and_row' . ($report['advanced_logic'] != '' ? ' hidden' : ''), 'style' => $display_limiter_and_row ? '' : 'display:none;'), RCView::td(array('class' => 'labelrc', 'colspan' => 4, 'style' => 'padding:8px 60px;background:#ddd;'), RCView::select(array('lgo' => $limiter_counter, 'class' => 'lgoc x-form-text x-form-field', 'style' => 'padding-right:0;height:22px;color:#800000;', 'onchange' => "displaylimiterGroupOperRow(\$(this));"), $limiter_group_operator_options, $attr['limiter_group_operator'])));
         // Render row
         print RCView::tr(array('class' => 'limiter_row' . ($report['advanced_logic'] != '' ? ' hidden' : '')), RCView::td(array('class' => 'labelrc', 'style' => 'width:120px;'), RCView::span(array('style' => 'margin:0;' . ($limiter_field_num == 0 || $attr['limiter_group_operator'] == 'AND' ? 'visibility:hidden;' : '')), RCView::select(array('name' => 'limiter_group_operator[]', 'lgo' => $limiter_counter, 'class' => 'lgoo x-form-text x-form-field', 'style' => 'font-size:11px;padding: 0 0 0 2px;', 'onchange' => "displaylimiterGroupOperRow(\$(this));"), $limiter_group_operator_options, $attr['limiter_group_operator'])) . RCView::span(array('style' => 'margin-left:10px;'), $lang['report_builder_31'] . " " . RCView::span(array('class' => 'limiter_num'), $limiter_counter++))) . RCView::td(array('class' => 'labelrc', 'valign' => 'top'), RCView::div(array('class' => 'field-auto-suggest-div nowrap', 'style' => $attr['field_name'] != '' ? 'display:none;' : ''), self::outputFieldAutoSuggest() . RCView::button(array('title' => $lang['report_builder_32'], 'class' => 'jqbuttonsm limiter-dropdown-a', 'onclick' => "showLimiterFieldAutoSuggest(\$(this),true);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'dropdown.png', 'style' => 'vertical-align:middle;')))) . RCView::div(array('class' => 'limiter-dropdown-div nowrap', 'style' => $attr['field_name'] == '' ? 'display:none;' : ''), self::outputLimiterDropdown($rc_field_dropdown_options, $attr['field_name']) . RCView::button(array('title' => $lang['report_builder_30'], 'class' => 'jqbuttonsm field-auto-suggest-a', 'onclick' => "showLimiterFieldAutoSuggest(\$(this),false);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'form-text-box.gif', 'style' => 'vertical-align:middle;'))))) . RCView::td(array('class' => 'labelrc nowrap', 'valign' => 'top'), self::outputLimiterOperatorDropdown($attr['field_name'], $attr['limiter_operator'], $allValTypes) . self::outputLimiterValueTextboxOrDropdown($attr['field_name'], $attr['limiter_value'])) . RCView::td(array('class' => 'labelrc', 'style' => 'text-align:center;width:25px;'), RCView::a(array('href' => 'javascript:;', 'onclick' => "deleteLimiterField(\$(this));", 'style' => $attr['field_name'] == '' ? 'display:none;' : ''), RCView::img(array('src' => 'cross.png', 'class' => 'imgfix opacity75', 'title' => $lang['design_170'])))));
         $limiter_field_num++;
     }
     ## ADVANCED LOGIC TEXTBOX
     print RCView::tr(array('id' => 'adv_logic_row_link', 'style' => $report['advanced_logic'] != '' ? 'display:none;' : ''), RCView::td(array('colspan' => '4', 'class' => 'labelrc', 'style' => 'padding:10px;color:#444;font-weight:normal;'), RCView::img(array('src' => 'arrow_circle_double_gray.gif', 'class' => 'imgfix')) . $lang['report_builder_92'] . RCView::SP . RCView::SP . RCView::a(array('href' => 'javascript:;', 'style' => 'text-decoration:underline;font-weight:normal;', 'onclick' => "showAdvancedLogicRow(true,false)"), $lang['report_builder_90'])));
     print RCView::tr(array('id' => 'adv_logic_row', 'style' => $report['advanced_logic'] == '' ? 'display:none;' : ''), RCView::td(array('colspan' => '4', 'class' => 'labelrc', 'style' => 'padding:10px;'), RCView::div(array('style' => 'margin:0 0 4px;'), RCView::div(array('style' => 'float:left;'), $lang['report_builder_93']) . RCView::div(array('style' => 'margin:0 30px;float:right;'), RCView::a(array('href' => 'javascript:;', 'style' => 'text-decoration:underline;font-size:11px;font-weight:normal;', 'onclick' => "helpPopup('logic_functions');"), $lang['dataqueries_79'])) . RCView::div(array('style' => 'float:right;font-size:11px;color:#666;font-weight:normal;'), '(e.g., [age] > 30 and [gender] = "1")') . RCView::div(array('class' => 'clear'), '')) . RCView::textarea(array('name' => 'advanced_logic', 'class' => 'x-form-field notesbox', 'style' => 'width:95%;height:46px;', 'onblur' => "check_advanced_logic();"), $report['advanced_logic'])));
     print RCView::tr(array('id' => 'adv_logic_row_link2', 'style' => $report['advanced_logic'] == '' ? 'display:none;' : ''), RCView::td(array('colspan' => '4', 'class' => 'labelrc', 'style' => 'padding:10px;color:#444;font-weight:normal;'), RCView::img(array('src' => 'arrow_circle_double_gray.gif', 'class' => 'imgfix')) . $lang['report_builder_92'] . RCView::SP . RCView::SP . RCView::a(array('href' => 'javascript:;', 'style' => 'text-decoration:underline;font-weight:normal;', 'onclick' => "showAdvancedLogicRow(false)"), $lang['report_builder_91'])));
     ## ADDITIONAL FILTERS (only if has events and/or DAGs)
     if (!empty($dag_dropdown_options)) {
         print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom', 'style' => 'background:#fff;border-left:0;border-right:0;height:5px;'), ''));
         // "Additional filters" section header
         print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom'), RCView::div(array('style' => 'float:left;'), RCView::img(array('src' => 'filter.gif', 'class' => 'imgfix')) . $lang['report_builder_36'] . " " . RCView::span(array('style' => 'font-weight:normal;'), $lang['global_06'])) . RCView::div(array('style' => 'float:right;margin:0 20px 0 0;font-size:11px;color:#555;font-weight:normal;'), $lang['report_builder_106']) . RCView::div(array('class' => 'clear'), '')));
         print RCView::tr(array(), RCView::td(array('class' => 'labelrc', 'colspan' => 4, 'valign' => 'top', 'style' => ''), RCView::div(array('style' => (empty($dag_dropdown_options) ? 'display:none;' : '') . 'float:left;margin-bottom:5px;'), RCView::span(array('style' => 'margin:0 10px 0 ' . ($Proj->longitudinal ? '50px;' : '20px;') . 'vertical-align:top;position:relative;top:4px;float:left;width:110px;'), $lang['report_builder_39']) . RCView::select(array('multiple' => '', 'class' => 'x-form-text x-form-field', 'style' => 'font-size:11px;padding-right:15px;height:80px;', 'name' => 'filter_dags'), $dag_dropdown_options, $report['filter_dags'], 200)) . RCView::div(array('style' => 'clear:both;padding:10px 0 0 3px;font-size:11px;font-weight:normal;color:#888;'), $lang['report_builder_40'])));
     }
     ## SORTING FIELDS USED IN REPORT
     // "Sorting" section header
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom', 'style' => 'padding:0;background:#fff;border-left:0;border-right:0;height:45px;'), RCView::div(array('style' => 'color:#444;position:relative;top:10px;background-color:#ddd;border:1px solid #ccc;border-bottom:1px solid #ddd;float:left;padding:5px 8px;'), $lang['global_117'] . " 4")));
     print RCView::tr(array(), RCView::td(array('class' => 'labelrc create_rprt_hdr', 'colspan' => 4, 'valign' => 'bottom'), RCView::img(array('src' => 'sort_ascend.png', 'class' => 'imgfix')) . $lang['report_builder_20'] . " " . RCView::span(array('style' => 'font-weight:normal;'), $lang['global_06'])));
     // SORT FIELD 1
     print RCView::tr(array('class' => 'sort_row'), RCView::td(array('class' => 'labelrc', 'style' => 'width:120px;'), $lang['report_builder_25']) . RCView::td(array('class' => 'labelrc', 'valign' => 'top'), RCView::div(array('class' => 'field-auto-suggest-div nowrap', 'style' => $report['orderby_field1'] != '' ? 'display:none;' : ''), self::outputFieldAutoSuggest() . RCView::button(array('title' => $lang['report_builder_32'], 'class' => 'jqbuttonsm sort-dropdown-a', 'onclick' => "showSortFieldAutoSuggest(\$(this),true);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'dropdown.png', 'style' => 'vertical-align:middle;')))) . RCView::div(array('class' => 'sort-dropdown-div nowrap', 'style' => $report['orderby_field1'] == '' ? 'display:none;' : ''), self::outputSortingDropdown($rc_field_dropdown_options_orderby, $report['orderby_field1']) . RCView::button(array('title' => $lang['report_builder_30'], 'class' => 'jqbuttonsm field-auto-suggest-a', 'onclick' => "showSortFieldAutoSuggest(\$(this),false);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'form-text-box.gif', 'style' => 'vertical-align:middle;'))))) . RCView::td(array('class' => 'labelrc', 'valign' => 'top', 'colspan' => 2), self::outputSortAscDescDropdown($report['orderby_sort1'])));
     // SORT FIELD 2
     print RCView::tr(array('class' => 'sort_row'), RCView::td(array('class' => 'labelrc', 'style' => 'width:120px;'), $lang['report_builder_26']) . RCView::td(array('class' => 'labelrc', 'valign' => 'top'), RCView::div(array('class' => 'field-auto-suggest-div nowrap', 'style' => $report['orderby_field2'] != '' ? 'display:none;' : ''), self::outputFieldAutoSuggest() . RCView::button(array('title' => $lang['report_builder_32'], 'class' => 'jqbuttonsm sort-dropdown-a', 'onclick' => "showSortFieldAutoSuggest(\$(this),true);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'dropdown.png', 'style' => 'vertical-align:middle;')))) . RCView::div(array('class' => 'sort-dropdown-div nowrap', 'style' => $report['orderby_field2'] == '' ? 'display:none;' : ''), self::outputSortingDropdown($rc_field_dropdown_options_orderby, $report['orderby_field2']) . RCView::button(array('title' => $lang['report_builder_30'], 'class' => 'jqbuttonsm field-auto-suggest-a', 'onclick' => "showSortFieldAutoSuggest(\$(this),false);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'form-text-box.gif', 'style' => 'vertical-align:middle;'))))) . RCView::td(array('class' => 'labelrc', 'valign' => 'top', 'colspan' => 2), self::outputSortAscDescDropdown($report['orderby_sort2'])));
     // SORT FIELD 3
     print RCView::tr(array('class' => 'sort_row'), RCView::td(array('class' => 'labelrc', 'style' => 'width:120px;'), $lang['report_builder_26']) . RCView::td(array('class' => 'labelrc', 'valign' => 'top'), RCView::div(array('class' => 'field-auto-suggest-div nowrap', 'style' => $report['orderby_field3'] != '' ? 'display:none;' : ''), self::outputFieldAutoSuggest() . RCView::button(array('title' => $lang['report_builder_32'], 'class' => 'jqbuttonsm sort-dropdown-a', 'onclick' => "showSortFieldAutoSuggest(\$(this),true);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'dropdown.png', 'style' => 'vertical-align:middle;')))) . RCView::div(array('class' => 'sort-dropdown-div nowrap', 'style' => $report['orderby_field3'] == '' ? 'display:none;' : ''), self::outputSortingDropdown($rc_field_dropdown_options_orderby, $report['orderby_field3']) . RCView::button(array('title' => $lang['report_builder_30'], 'class' => 'jqbuttonsm field-auto-suggest-a', 'onclick' => "showSortFieldAutoSuggest(\$(this),false);return false;", 'style' => 'font-size:11px;'), RCView::img(array('src' => 'form-text-box.gif', 'style' => 'vertical-align:middle;'))))) . RCView::td(array('class' => 'labelrc', 'valign' => 'top', 'colspan' => 2), self::outputSortAscDescDropdown($report['orderby_sort3'])));
     // Set table html
     print "</table>\n\t\t\t\t\t</form>" . RCView::div(array('style' => 'text-align:center;margin:30px 0 50px;'), RCView::button(array('class' => 'jqbuttonmed', 'style' => 'font-weight:bold;font-size:14px;', 'onclick' => "saveReport({$report_id});"), $lang['report_builder_27']) . RCView::a(array('href' => 'javascript:;', 'style' => 'text-decoration:underline;margin-left:20px;font-size:13px;', 'onclick' => 'history.go(-1)'), $lang['global_53'])) . "</div>";
 }