Minor - format code, block page if career doesn't exists.

pull/3023/head
Julio 6 years ago
parent 6501c3b497
commit 7e5a28e9ff
  1. 11
      main/admin/careers.php
  2. 2
      main/inc/lib/career.lib.php

@ -73,9 +73,8 @@ $column_model = [
'sortable' => 'false',
],
];
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$diagramLink = '';
@ -144,8 +143,13 @@ switch ($action) {
break;
case 'edit':
api_protect_admin_script();
$id = isset($_GET['id']) ? (int) $_GET['id'] : null;
$careerInfo = $career->get($id);
if (empty($careerInfo)) {
api_not_allowed(true);
}
// Action handling: Editing
$url = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
$url = api_get_self().'?action=edit&id='.$id;
$form = $career->return_form($url, 'edit');
// The validation or display
@ -230,7 +234,6 @@ switch ($action) {
break;
}
// The header.
Display::display_header($tool_name);
?>

@ -169,8 +169,6 @@ class Career extends Model
$form->setDefaults($defaults);
// Setting the rules
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');

Loading…
Cancel
Save