forked from science-ation/science-ation
Disable question fields in the editor that aren't in use.
This commit is contained in:
parent
16567265d6
commit
c527e349c8
@ -46,6 +46,7 @@
|
|||||||
echo "<select name=\"$name\" id=\"$id\">";
|
echo "<select name=\"$name\" id=\"$id\">";
|
||||||
echo "<option value=\"\" />-- None --</option>";
|
echo "<option value=\"\" />-- None --</option>";
|
||||||
foreach($fields as $k=>$f) {
|
foreach($fields as $k=>$f) {
|
||||||
|
if($f['editor_disabled'] == true) continue;
|
||||||
$sel = ($selected == $k) ? 'selected=\"selected\"': '' ;
|
$sel = ($selected == $k) ? 'selected=\"selected\"': '' ;
|
||||||
echo "<option value=\"$k\" $sel >{$f['name']}</option>";
|
echo "<option value=\"$k\" $sel >{$f['name']}</option>";
|
||||||
}
|
}
|
||||||
|
@ -380,6 +380,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q1',
|
'header' => 'Q1',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true, /* Only disables in the report editor, a report can still use it */
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'question_2' => array(
|
'question_2' => array(
|
||||||
@ -387,6 +388,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q2',
|
'header' => 'Q2',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true,
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'question_3' => array(
|
'question_3' => array(
|
||||||
@ -394,6 +396,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q3',
|
'header' => 'Q3',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true,
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'question_4' => array(
|
'question_4' => array(
|
||||||
@ -401,6 +404,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q4',
|
'header' => 'Q4',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true,
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'question_5' => array(
|
'question_5' => array(
|
||||||
@ -408,6 +412,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q5',
|
'header' => 'Q5',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true,
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'question_6' => array(
|
'question_6' => array(
|
||||||
@ -415,6 +420,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q6',
|
'header' => 'Q6',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true,
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'question_7' => array(
|
'question_7' => array(
|
||||||
@ -422,6 +428,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q7',
|
'header' => 'Q7',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true,
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'question_8' => array(
|
'question_8' => array(
|
||||||
@ -429,6 +436,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q8',
|
'header' => 'Q8',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true,
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'question_9' => array(
|
'question_9' => array(
|
||||||
@ -436,6 +444,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q9',
|
'header' => 'Q9',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true,
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'question_10' => array(
|
'question_10' => array(
|
||||||
@ -443,6 +452,7 @@ $report_judges_fields = array(
|
|||||||
'header' => 'Q10',
|
'header' => 'Q10',
|
||||||
'width' => 1,
|
'width' => 1,
|
||||||
'table' => 'users.id',
|
'table' => 'users.id',
|
||||||
|
'editor_disabled' => true,
|
||||||
'exec_function' => 'report_judges_custom_question'),
|
'exec_function' => 'report_judges_custom_question'),
|
||||||
|
|
||||||
'static_text' => array(
|
'static_text' => array(
|
||||||
@ -467,6 +477,7 @@ function report_judges_update_questions($year)
|
|||||||
$f = "question_{$q['ord']}";
|
$f = "question_{$q['ord']}";
|
||||||
$report_judges_fields[$f]['header'] = $q['db_heading'];
|
$report_judges_fields[$f]['header'] = $q['db_heading'];
|
||||||
$report_judges_fields[$f]['name'] = 'Judge -- Custom Judge Question: '.$q['question'];
|
$report_judges_fields[$f]['name'] = 'Judge -- Custom Judge Question: '.$q['question'];
|
||||||
|
$report_judges_fields[$f]['editor_disabled'] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user