Fix show course extra fields - refs BT#9413

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent 263290de55
commit 0b7a2394cf
  1. 2
      main/admin/course_edit.php
  2. 18
      main/inc/lib/extra_field.lib.php

@ -232,7 +232,7 @@ if (!empty($specialCourseFieldInfo)) {
//Extra fields
$extra_field = new ExtraField('course');
$extra = $extra_field->addElements($form, $courseId);
$extra = $extra_field->addElements($form, $courseId, ['special_course']);
$htmlHeadXtra[] = '
<script>

@ -302,11 +302,11 @@ class ExtraField extends Model
* Add elements to a form
*
* @param FormValidator $form
* @param int $itemId
*
* @param int $itemId
* @param array $exclude variables of extra field to exclude
* @return array|bool
*/
public function addElements($form, $itemId = 0)
public function addElements($form, $itemId = 0, $exclude = [])
{
if (empty($form)) {
return false;
@ -329,7 +329,8 @@ class ExtraField extends Model
$extraData,
false,
$extraFields,
$itemId
$itemId,
$exclude
);
return $extra;
@ -629,7 +630,7 @@ class ExtraField extends Model
* @param int $user_id
* @param array $extra
* @param int $itemId
*
* @param array $exclude variables of extra field to exclude
* @return array
*/
public function set_extra_fields_in_form(
@ -637,7 +638,8 @@ class ExtraField extends Model
$extraData,
$admin_permissions = false,
$extra = array(),
$itemId = null
$itemId = null,
$exclude = []
) {
$type = $this->type;
@ -669,6 +671,10 @@ class ExtraField extends Model
if ($field_details['visible'] == 0) {
continue;
}
if (in_array($field_details['variable'], $exclude)) {
continue;
}
}
switch ($field_details['field_type']) {

Loading…
Cancel
Save