Merge pull request #4903 from christianbeeznest/ofaj-21049

Session: Add order by id in field session model - refs BT#21049
pull/4904/head
christianbeeznest 2 years ago committed by GitHub
commit 093335359b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      public/main/inc/ajax/session.ajax.php
  2. 3
      src/CoreBundle/Settings/SessionSettingsSchema.php

@ -439,7 +439,11 @@ switch ($action) {
}
$q = strtolower(trim($_GET['q']));
$options = [];
if ('true' === api_get_setting('session.session_model_list_field_ordered_by_id')) {
$orderBy = "s.id";
$options['order'] = $orderBy;
}
$list = array_map(
function ($session) {
return [
@ -447,7 +451,7 @@ switch ($action) {
'text' => strip_tags($session['name']),
];
},
SessionManager::formatSessionsAdminForGrid()
SessionManager::formatSessionsAdminForGrid($options)
);
$list = array_filter(

@ -81,6 +81,7 @@ class SessionSettingsSchema extends AbstractSettingsSchema
'email_template_subscription_to_session_confirmation_lost_password' => 'false',
'session_creation_user_course_extra_field_relation_to_prefill' => '',
'session_creation_form_set_extra_fields_mandatory' => '',
'session_model_list_field_ordered_by_id' => 'false',
]
)
;
@ -227,7 +228,7 @@ class SessionSettingsSchema extends AbstractSettingsSchema
$this->settingArrayHelpValue('session_creation_form_set_extra_fields_mandatory'),
]
)
->add('session_model_list_field_ordered_by_id', YesNoType::class)
;
}

Loading…
Cancel
Save