Skip to content

Commit d9d4376

Browse files
committed
Career: Fix change name to title in queries
1 parent b46613e commit d9d4376

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

public/main/admin/careers.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
// Column config
5151
$column_model = [
5252
[
53-
'name' => 'name',
54-
'index' => 'name',
53+
'name' => 'title',
54+
'index' => 'title',
5555
'width' => '200',
5656
'align' => 'left',
5757
],
@@ -166,15 +166,15 @@
166166
if ($values['status'] && !$old_status) {
167167
Display::addFlash(
168168
Display::return_message(
169-
sprintf(get_lang('The <i>%s</i> career has been unarchived. This action has the consequence of making visible the career, its promotions and all the sessions registered into this promotion. You can undo this by archiving the career.'), $values['name']),
169+
sprintf(get_lang('The <i>%s</i> career has been unarchived. This action has the consequence of making visible the career, its promotions and all the sessions registered into this promotion. You can undo this by archiving the career.'), $values['title']),
170170
'confirmation',
171171
false
172172
)
173173
);
174174
} elseif (!$values['status'] && $old_status) {
175175
Display::addFlash(
176176
Display::return_message(
177-
sprintf(get_lang('The <i>%s</i> career has been archived. This action has the consequence of making invisible the career, its promotions and all the sessions registered into this promotion. You can undo this by unarchiving the career.'), $values['name']),
177+
sprintf(get_lang('The <i>%s</i> career has been archived. This action has the consequence of making invisible the career, its promotions and all the sessions registered into this promotion. You can undo this by unarchiving the career.'), $values['title']),
178178
'confirmation',
179179
false
180180
)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,9 +2291,9 @@ function getWhereClause($col, $oper, $val)
22912291
$result = $new_result;
22922292
break;
22932293
case 'get_careers':
2294-
$columns = ['name', 'description', 'actions'];
2294+
$columns = ['title', 'description', 'actions'];
22952295
if (!in_array($sidx, $columns)) {
2296-
$sidx = 'name';
2296+
$sidx = 'title';
22972297
}
22982298
$result = Database::select(
22992299
'*',
@@ -2303,7 +2303,7 @@ function getWhereClause($col, $oper, $val)
23032303
$new_result = [];
23042304
foreach ($result as $item) {
23052305
if (!$item['status']) {
2306-
$item['name'] = '<font style="color:#AAA">'.$item['name'].'</font>';
2306+
$item['title'] = '<font style="color:#AAA">'.$item['title'].'</font>';
23072307
}
23082308
$new_result[] = $item;
23092309
}

public/main/inc/lib/career.lib.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function return_form($url, $action)
121121
$id = isset($_GET['id']) ? (int) $_GET['id'] : '';
122122
$form->addHeader($header);
123123
$form->addHidden('id', $id);
124-
$form->addText('name', get_lang('Name'), true, ['size' => '70']);
124+
$form->addText('title', get_lang('Title'), true, ['size' => '70']);
125125
$form->addHtmlEditor(
126126
'description',
127127
get_lang('Description'),
@@ -160,7 +160,7 @@ public function return_form($url, $action)
160160
$form->setDefaults($defaults);
161161

162162
// Setting the rules
163-
$form->addRule('name', get_lang('Required field'), 'required');
163+
$form->addRule('title', get_lang('Required field'), 'required');
164164

165165
return $form;
166166
}
@@ -240,7 +240,7 @@ public function save($params, $showQuery = false)
240240
{
241241
$career = new CareerEntity();
242242
$career
243-
->setTitle($params['name'])
243+
->setTitle($params['title'])
244244
->setStatus((int) $params['status'])
245245
->setDescription($params['description']);
246246

0 commit comments

Comments
 (0)