Redirect to edit page after logbook creation

After creating a new logbook, users are now redirected to the edit page for the newly created logbook instead of the logbooks list. The add method in Logbooks_model now returns the new logbook ID to support this change.
This commit is contained in:
Peter Goodhall 2025-11-22 14:38:53 +00:00
parent 93ba9f7337
commit f2b8a3eeaa
2 changed files with 4 additions and 2 deletions

View file

@ -43,9 +43,9 @@ class Logbooks extends CI_Controller {
else
{
$this->load->model('logbooks_model');
$this->logbooks_model->add();
$new_logbook_id = $this->logbooks_model->add();
redirect('logbooks');
redirect('logbooks/edit/' . $new_logbook_id);
}
}

View file

@ -52,6 +52,8 @@ class Logbooks_model extends CI_Model {
$CI->load->model('user_model');
$CI->user_model->update_session($this->session->userdata('user_id'));
}
return $logbook_id;
}
function CreateDefaultLogbook() {