Skip to content

Commit d4e35e5

Browse files
committed
Fix model.ajax.php using name in tables
1 parent e11f6b6 commit d4e35e5

File tree

8 files changed

+36
-36
lines changed

8 files changed

+36
-36
lines changed

public/main/admin/grade_models.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ function minItem(item) {
6868

6969
//The order is important you need to check the the $column variable in the model.ajax.php file
7070
$columns = [
71-
get_lang('Name'),
71+
get_lang('Title'),
7272
get_lang('Description'),
7373
get_lang('Detail'),
7474
];
7575

7676
//Column config
7777
$column_model = [
7878
[
79-
'name' => 'name',
80-
'index' => 'name',
79+
'name' => 'title',
80+
'index' => 'title',
8181
'width' => '80',
8282
'align' => 'left',
8383
],

public/main/exercise/category.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333

3434
//The order is important you need to check the the $column variable in the model.ajax.php file
3535
$columns = [
36-
get_lang('Name'),
36+
get_lang('Title'),
3737
get_lang('Actions'),
3838
];
3939

4040
// Column config
4141
$column_model = [
4242
[
43-
'name' => 'name',
44-
'index' => 'name',
43+
'name' => 'title',
44+
'index' => 'title',
4545
'width' => '340px',
4646
'align' => 'left',
4747
],

public/main/inc/ajax/model.ajax.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,15 +1039,15 @@ function getWhereClause($col, $oper, $val)
10391039

10401040
switch ($action) {
10411041
case 'get_exercise_categories':
1042-
$columns = ['name', 'actions'];
1042+
$columns = ['title', 'actions'];
10431043
$qb = $repo->getResourcesByCourse(api_get_course_entity($courseId));
10441044
$items = $qb->getQuery()->getResult();
10451045
/** @var CQuizCategory $item */
10461046
$result = [];
10471047
foreach ($items as $item) {
10481048
$result[] = [
10491049
'id' => $item->getId(),
1050-
'name' => $item->getTitle(),
1050+
'title' => $item->getTitle(),
10511051
];
10521052
}
10531053
break;
@@ -1115,8 +1115,8 @@ function getWhereClause($col, $oper, $val)
11151115
}
11161116
break;
11171117
case 'get_group_reporting':
1118-
$columns = ['name', 'time', 'progress', 'score', 'works', 'messages', 'actions'];
1119-
$sidx = in_array($sidx, $columns) ? $sidx : 'name';
1118+
$columns = ['title', 'time', 'progress', 'score', 'works', 'messages', 'actions'];
1119+
$sidx = in_array($sidx, $columns) ? $sidx : 'title';
11201120

11211121
$result = Tracking::get_group_reporting(
11221122
$course_id,
@@ -1310,7 +1310,7 @@ function getWhereClause($col, $oper, $val)
13101310
$userGroup = new UserGroupModel();
13111311
foreach ($result as &$item) {
13121312
$userGroups = $userGroup->get_groups_by_user($item['user_id']);
1313-
$item['group'] = implode(", ", array_column($userGroups, 'name'));
1313+
$item['group'] = implode(", ", array_column($userGroups, 'title'));
13141314
unset($item['user_id']);
13151315
}
13161316
}
@@ -1912,7 +1912,7 @@ function getWhereClause($col, $oper, $val)
19121912
);
19131913

19141914
$item = [
1915-
'name' => Display::url(
1915+
'title' => Display::url(
19161916
$session['title'],
19171917
api_get_path(WEB_CODE_PATH).'my_space/course.php?sid='.$session['id']
19181918
),
@@ -2232,9 +2232,9 @@ function getWhereClause($col, $oper, $val)
22322232
);
22332233
break;
22342234
case 'get_gradebooks':
2235-
$columns = ['name', 'certificates', 'skills', 'actions', 'has_certificates'];
2235+
$columns = ['title', 'certificates', 'skills', 'actions', 'has_certificates'];
22362236
if (!in_array($sidx, $columns)) {
2237-
$sidx = 'name';
2237+
$sidx = 'title';
22382238
}
22392239
$result = Database::select(
22402240
'*',
@@ -2251,12 +2251,12 @@ function getWhereClause($col, $oper, $val)
22512251
$courseInfo = api_get_course_info_by_id($courseId);
22522252

22532253
//Fixes bug when gradebook doesn't have names
2254-
if (empty($item['name'])) {
2255-
$item['name'] = $courseInfo['code'];
2254+
if (empty($item['title'])) {
2255+
$item['title'] = $courseInfo['code'];
22562256
}
22572257

2258-
$item['name'] = Display::url(
2259-
$item['name'],
2258+
$item['title'] = Display::url(
2259+
$item['title'],
22602260
api_get_path(WEB_CODE_PATH).'gradebook/index.php?sid=0&cid='.$courseInfo['real_id']
22612261
);
22622262

@@ -2283,7 +2283,7 @@ function getWhereClause($col, $oper, $val)
22832283
if (!empty($skills)) {
22842284
$item['skills'] = '';
22852285
foreach ($skills as $skill) {
2286-
$item['skills'] .= Display::span($skill['name'], ['class' => 'label_tag skill']);
2286+
$item['skills'] .= Display::span($skill['title'], ['class' => 'label_tag skill']);
22872287
}
22882288
}
22892289
$new_result[] = $item;
@@ -2357,9 +2357,9 @@ function getWhereClause($col, $oper, $val)
23572357
$result = $new_result;
23582358
break;
23592359
case 'get_grade_models':
2360-
$columns = ['name', 'description', 'actions'];
2360+
$columns = ['title', 'description', 'actions'];
23612361
if (!in_array($sidx, $columns)) {
2362-
$sidx = 'name';
2362+
$sidx = 'title';
23632363
}
23642364
$result = Database::select(
23652365
'*',
@@ -2451,8 +2451,8 @@ function getWhereClause($col, $oper, $val)
24512451
$column_names[] = get_lang('Username');
24522452
break;
24532453
case 3:
2454-
$columns[] = 'name';
2455-
$column_names[] = get_lang('Name');
2454+
$columns[] = 'title';
2455+
$column_names[] = get_lang('Title');
24562456
break;
24572457
case $cntExer:
24582458
$columns[] = 'finalScore';
@@ -2506,7 +2506,7 @@ function getWhereClause($col, $oper, $val)
25062506
$i = 0;
25072507
foreach ($users as $user) {
25082508
$sessionInfo = SessionManager::fetch($listUserSess[$user['user_id']]['id_session']);
2509-
$result[$i]['session'] = $sessionInfo['name'];
2509+
$result[$i]['session'] = $sessionInfo['title'];
25102510
$result[$i]['username'] = $user['username'];
25112511
$result[$i]['name'] = $user['lastname']." ".$user['firstname'];
25122512
$j = 1;
@@ -2622,7 +2622,7 @@ function getWhereClause($col, $oper, $val)
26222622
}
26232623

26242624
if (!in_array($sidx, $columns)) {
2625-
$sidx = 'name';
2625+
$sidx = 'title';
26262626
}
26272627
// Multidimensional sort
26282628
$result = msort($result, $sidx, $sord);

public/main/inc/lib/ExerciseCategoryManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function return_form($url, $action)
230230

231231
$form->addText(
232232
'title',
233-
get_lang('Name')
233+
get_lang('Title')
234234
);
235235

236236
$form->addHtmlEditor('description', get_lang('Description'));

public/main/inc/lib/tracking.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6982,7 +6982,7 @@ public static function getCourseLpProgress($userId, $sessionId)
69826982
$progress = self::get_avg_student_progress($userId, $courseCode, [], $sessionId);
69836983

69846984
$result[] = [
6985-
'module' => $courseInfo['name'],
6985+
'module' => $courseInfo['title'],
69866986
'progress' => $progress,
69876987
'qualification' => $totalProgress,
69886988
'activeTime' => $totalTime,

public/main/my_space/session.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,14 +476,14 @@ function clean_cols(grid, added_cols) {
476476
for (key in added_cols) {
477477
grid.hideCol(key);
478478
}
479-
grid.showCol('name');
479+
grid.showCol('title');
480480
grid.showCol('display_start_date');
481481
grid.showCol('display_end_date');
482482
grid.showCol('course_title');
483483
}
484484

485485
function show_cols(grid, added_cols) {
486-
grid.showCol('name').trigger('reloadGrid');
486+
grid.showCol('title').trigger('reloadGrid');
487487
for (key in added_cols) {
488488
grid.showCol(key);
489489
}

public/main/skills/skills_gradebook.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
3131
$gradebook_info = $gradebook->get($id);
3232
$url = api_get_self().'?action='.$action.'&id='.$id;
33-
$form = $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
33+
$form = $gradebook->show_skill_form($id, $url, $gradebook_info['title']);
3434
if ($form->validate()) {
3535
$values = $form->exportValues();
3636
$gradebook->updateSkillsToGradeBook($values['id'], $values['skill']);
@@ -49,7 +49,7 @@
4949

5050
//The order is important you need to check the the $column variable in the model.ajax.php file
5151
$columns = [
52-
get_lang('Name'),
52+
get_lang('Title'),
5353
get_lang('Certificates'),
5454
get_lang('Skills'),
5555
get_lang('Detail'),
@@ -58,8 +58,8 @@
5858
//Column config
5959
$column_model = [
6060
[
61-
'name' => 'name',
62-
'index' => 'name',
61+
'name' => 'title',
62+
'index' => 'title',
6363
'width' => '150',
6464
'align' => 'left',
6565
],

public/main/tracking/course_log_groups.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
// The order is important you need to check the the $column variable in the model.ajax.php file
3232
$columns = [
33-
get_lang('Name'),
33+
get_lang('Title'),
3434
get_lang('Time'),
3535
get_lang('Progress'),
3636
get_lang('Score'),
@@ -42,8 +42,8 @@
4242
// Column config
4343
$column_model = [
4444
[
45-
'name' => 'name',
46-
'index' => 'name',
45+
'name' => 'title',
46+
'index' => 'title',
4747
'width' => '200',
4848
'align' => 'left',
4949
],

0 commit comments

Comments
 (0)